[TYPO3-core] FYI: Raised Extbase and Fluid versions to 1.2.0beta1

Sebastian Kurfürst sebastian at typo3.org
Sun May 2 16:45:21 CEST 2010


Hey everybody,

I just committed the extbase and fluid versions 1.2.0beta1, ready to be
included in the next beta.

Both changelogs since the last version are following.

For Fluid,there were mostly bugfixes, and in Extbase, the main additon
was proper implementation of single table inhertiance.

Greets,
Sebastian



Fluid:
[+BUGFIX] Fluid (ViewHelpers): escapeViewHelper now takes encoding of
resulting web page into account. Resolves #7292.
Updated ext_autoload.php to match Backport in Rev 2043
[+FEATURE] Fluid (ViewHelpers): The <f:form.error> ViewHelper now
supports property paths for the "for"-Argument. Now, one can display
only the errors of a given property of an object. Example: In the Blog
Example, one could now write <f:form.errors for="blog.title">.
[+TASK] Fluid (ViewHelpers): Improved Documentation in *PageViewHelper.
Thanks to Falk Kühnel for the suggestion! Resolves #6297.
[+BUGFIX] Fluid (ViewHelpers): f:link.action can now be used inside
f:form without breaking hmac verification. Resolves #6809, Resolves
#6808, Resolves #6514. Thanks to Peter Niederlag for providing a patch!


Extbase:

[!!!][~TASK][~API] Extbase (Persistence): $query->execute() now returns
a plain array of row-arrays instead of an RowIterator. This is a
breaking change if you use your own Query object in combination with
$querySettings->getRawQueryResult = TRUE.
[!!!][+FEATURE] Extbase (Persistence): Implemented Single Table
Inheritance. Resolves to #5883.
 * Implemented new option "subclasses" to define the classes extending
the class.
 * Extbase doesn't ascend the class hierarchy anymore. You have to
specify the table name explicity via
"plugin.tx_myext.persistence.classes.[className].mapping.tableName =
foo" if it is different from the lowercased class name.
 * Implemented option recordType to map record types of existing tables
(e.g. CType "text" in "tt_content"). If you want to use the type field
yo have to specify a recordType now. It is recommended to use the class name
[!!!][~TASK] Extbase (Property): Changed behavior of transforming a
value coming from a form into a property value. An empty field (empty
string) now results in NULL instead of a DateTime( "now") object. Please
check the bahavior of your extensions.

[+FEATURE][+API] Extbase (Domain): Add new fields to FrontendUser model.
Thanks to Steffen Mueller who provided the patch. Resolves #6244.
[+FEATURE][+API] Extbase (Persistence): Added countAll() and
countByProperty('foo') to the Persistence Repository. thanks to martin
Kutschker who provided the patch. Resolves #6234.
[+FEATURE][+API] Extbase (Persistence): Implemented methods in() and
contains() in the Query-Object. Resolves #6707.
[+FEATURE][+API] Extbase (Persistence): It is now possible to ask
contains() for mm-relations, e.g. $query->contains('categories',
$category). Resolves #4679.
[+FEATURE][+API] Extbase (Persistence): Implemented removeAll() to the
Persistence Repository. Related to #3852. Resolves #6248.
[+FEATURE][+API] Extbase (Persistence): Implemented feature to be able
to formulate constraints accessing the object graph. It is now possible
to use the same object accessor syntax as in Fluid:
$query->lessThanOrEqual('ageRange.minimumValue', $age). Resolves #6755.
[+FEATURE][+API] Extbase (Persistence): Query::logicalAnd() and
Query::logicalOr() accepting an array of Constraints as argument, now.
Related to #6735.

For single table inheritance, here is a quick usage example:

[!!!] But before we start, note that there is a breaking change. Until
this rev. Extbase made a "best guess" for the table name if it was not
the lowercased class name (simply by crawling the class hierarchy
upwards trying to find a mapping rule or table). I have removed this
"magic" because It was very hard to understand what was happening; esp.
if there was an error.

Now, let's have a class hierarchy like

<pre>
                Party
                |   |
      Organization   Person
        |    |
   Company ScientificInstitution
</pre>

The class Party is a class of another extension. All the other classes
are part of my extension. The classes Party and Organization will never
get instanciated but their concrete classes Person, Company and
ScientificInstitution.

There are different ways to map this class hierarchy onto the Relational
Model of a database:

1) Map the entire class hierarchy to a single table.
    aka "Single Table Inheritance"
2) Map each concrete class to its own table.
    aka "Class Table Inheritance"
3) Map each class to its own table.
    aka "Concrete Table Inheritance"
4) Map the classes into a generic structure.

Examples:
1) Single Table Inheritance: All the data of the concrete classes
(Company, ScientificInstitution and Person) are stored in the single
table "party". This table has an extra field (could be any name)
indicating the record type (the class name by default). The name of the
extra field must be defined in the "ctrl" section of the TCA of the
table (key: "type").

If you query for Company objects through a CompanyRepository, you only
find objects of this particular type. But you can also have an
OrganizationRepository that is responsible for Objects of type Company
*and* ScientificInstitution. The configuration is

<pre>
config.tx_extbase.persistence.classes {
  Organization {
    mapping {
      tableName = party
    }
    subclasses {
      Company = Company
      ScientificInstitution = ScientificInstitution
    }
  }
  Person {
    mapping {
      tableName = party
    }
  }
  Company {
    mapping {
      tableName = party
    }
  }
  ScientificInstitution {
    mapping {
      tableName = party
    }
  }
}
</pre>

As you can see, you have to define the table name for every class that
is not stored in a table named as the lowercased class name.

There is a new option "subclasses" where you can specify, which classes
are subclasses and should be taken into account, too. This might be a
subset of the "real" subclasses in the class hierarchy. It might be
puzzling, that the statement is "Company = Company". The right part is
the class name. The left part can be any unique name (suggestion: the
class name).

Sometimes it is not possible to store the class name as record type.
think about mapping tt_content onto your class hierarchy. There is a
field called "CType". You can define, that the CType "text" should be
mapped onto your class "Tx_TemplaVoila_Domain_Model_Text". The
configuration is:

<pre>
config.tx_extbase.persistence.classes {
  Tx_TemplaVoila_Domain_Model_Text {
    mapping {
      tableName = tt_content
      recordType = text
    }
  }
}
</pre>

I am sure somebody is "furbo" enough to find this configuration:

<pre>
config.tx_extbase.persistence.classes {
  Client {
    mapping {
      tableName = party
      recordType = Person
    }
  }
}
</pre>

in comparison to

<pre>
config.tx_extbase.persistence.classes {
  Person {
    mapping {
      tableName = party
    }
  }
}
</pre>

But this is very bad style. Why? I am going to spend a beer on T3DD (or
any other event) for the best explanation. ;-)

2) Class Table Inheritance: currently not supported by Extbase.

3) Concrete Table Inheritance: There are tables for each of the concrete
classes Company, ScientificInstitution, and Person. No further
configuration needed. You can have a repository for each of the concrete
classes (but not for the class Organization, yet).

4) See FLOW3 ;-)


More information about the TYPO3-team-core mailing list