[TYPO3-mvc] [!!!] FYI: Breaking changes in recent commit of Extbase

Jochen Rau jochen.rau at typoplanet.de
Mon Mar 8 18:09:30 CET 2010


Hi.

I have done a refactoring of the persistence layer of Extbase according 
to the great improvements Karsten has done in FLOW3.

In addition I have implemented some handy improvements to 
Query::logicalAnd() and Query::logicalOr(). These improvements are not 
yet part of the API!! Please give feedback on them.

The first one allows multiple constraints as arguments. These arguments 
are catched by func_get_args().
$query->matching($query->logicalAnd($constraint1, $constraint2, 
$constraint3, $constraint4, $constraint5));

The second one is a kind of implode taking an array of constraints as 
argument.

$constraints = array($constraint1, $constraint2, $constraint3, 
$constraint4, $constraint5);
$query->matching($query->implodeAnd($constraints));

Both are easy to understand. The second one can be used chaining by 
foreach() and if an empty array is passed to the implode, NULL is 
returned which gives the expected result.

There are two new methods which are already part of FLOW3: 
Query::in($propertyName, array(...)) and 
Query::contains($propertyWithArray, 'foo'). This works already for 
mm-relations and comma separated values (ahrg, he said csv ;-)).

Here are the most important changes of the latest revisions:

[+API] Extbase (Persistence): Added countAll() and 
countByProperty('foo') to the Persistence Repository. thanks to Martin 
Kutschker who provided the patch. Resolves #6234.
[-TASK] Extbase (Persistence): Removed unnecessary classes, code and 
empty interfaces.
[!!!][~API] Extbase (Persistence): Marked Query::withUid() as 
deprecated. Will be removed with one of the next major versions of Extbase.
[+FEATURE] Extbase (Persistence): Implemented Query::implodeAnd(array) 
and Query::implodeOr(array). Please give Feedback on this Feature. This 
is not yet part of the API! Related to #6735.
[+FEATURE] Extbase (Persistence): Query::logicalAnd() and 
Query::logicalOr() allow 2 or more Constraints as argument, now. This is 
not yet part of the API! Please give Feedback on this Feature. Related 
to #6735.
[!!!][~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.
[~TASK] Extbase (Persistence): Refactored persistence layer (part I). 
Dropped QueryObjectModel. The Query-Object is now passed directly to the 
StorageBackend.
[+API] Extbase (Persistence): Implemented methods in() and contains() in 
the Query-Object. Resolves #6707.
[+FEATURE] Extbase (Persistence): It is now possible to ask contains() 
for mm-relations, e.g. $query->contains('categories', $category). 
Resolves #4679.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list