[Flow] fetching constraints from repository method
Dominique Feyer
dfeyer at ttree.ch
Fri Jul 25 13:50:36 CEST 2014
When you build contraints doctrine keep track of the number of variable that need to be mapped to the query, so you need to use the same query object during the process.
Bests,
--
ttree sàrl
Dominique Feyer
Rue du Valentin 34 et demi
CH - 1004 Lausanne
+41 21 312 36 35
dfeyer at ttree.ch
ttree.ch - @ttreeagency - plan d’accès
Le 25 juillet 2014 à 07:15:05, Alexander Wende (a_wende at web.de) a écrit:
Hi Dominique,
Quote: Dominique Feyer (dfeyer) wrote on Thu, 24 July 2014 18:04
----------------------------------------------------
> You can try to pass the current query to the method getDefaultConstraints, like this:
>
> /**
> * @return object
> */
> protected function getDefaultConstraints($query){
> $lastRevisionsConstraint = $query->equals('nextRevision',NULL);
> $notDeletedConstraint = $query->equals('deleted',"0");
> return $query->logicalAnd(array($lastRevisionsConstraint,$notDeletedConstraint));
> }
> }
Thanks! After some cache clearing, this works fine. For me, this behaviour is strange. Can anybody explain me why it isn't possible to return constraints which are created from an new query object? I thought that a constraint has no relation to the query object which created it.
Thanks in advance
_______________________________________________
Flow mailing list
Flow at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list