문제

im trying to write a simple query that would be easy if i had access to the persistence_object_identifier. I kickstarted my models and so i dont have them.

What i want to do is:

function getAllExcept($obj){
  $query = $this->createQuery();
  $query->matching(
     $query->logicalNot(
         $query->equals('persistence_object_identifier', $obj)
     )             
    );
  return $query->execute();
}

I tried a lot but i cannot make it work. I could easily call ->toArray() and filter the one object out, but the fluid pagination widget needs the QueryResultInterface...

도움이 되었습니까?

해결책

The property's name is Persistence_Object_Identifier (mind the case). It is injected by AOP in https://git.typo3.org/Packages/TYPO3.Flow.git/blob/HEAD:/Classes/TYPO3/Flow/Persistence/Aspect/PersistenceMagicAspect.php#l58.

다른 팁

replace

$query->equals('persistence_object_identifier', $obj);

with

$query->equals('Persistence_Object_Identifier', $obj);

It will work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top