[Flow] fetching constraints from repository method

Alexander Wende a_wende at web.de
Fri Jul 25 07:14:42 CEST 2014


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



More information about the Flow mailing list