Ejemplo n.º 1
0
 /**
  * Find all resources for type/customer
  *
  * @param \GK\Stdapp\Domain\Model\Customer $customer
  * @return \GK\Stdapp\Domain\Model\PortalUser
  */
 public function findOneByCustomer(\GK\Stdapp\Domain\Model\Customer $customer)
 {
     $querySettings = $this->objectManager->create('Tx_Extbase_Persistence_Typo3QuerySettings');
     $querySettings->setRespectStoragePage(FALSE);
     $this->setDefaultQuerySettings($querySettings);
     $query = $this->createQuery();
     $constraints = array();
     $constraints[] = $query->equals('customer', $customer->getUid());
     $query->matching($query->logicalAnd($constraints));
     return $query->execute()->getFirst();
 }