Example #1
0
 protected function findObjectByUid($dataType, $uid)
 {
     $query = $this->queryFactory->create($dataType);
     $query->getQuerySettings()->setRespectSysLanguage(FALSE);
     $query->getQuerySettings()->setRespectStoragePage(FALSE);
     return $query->matching($query->equals('uid', intval($uid)))->execute()->getFirst();
 }
 /**
  * Finds an object from the repository by searching for its technical UID.
  *
  * @param int $uid The object's uid
  * @return mixed Either the object matching the uid or, if none or more than one object was found, FALSE
  */
 protected function findObjectByUid($uid)
 {
     $query = $this->queryFactory->create($this->dataType);
     $query->getQuerySettings()->setRespectSysLanguage(FALSE);
     $result = $query->matching($query->equals('uid', $uid))->execute();
     $object = NULL;
     if (count($result) > 0) {
         $object = current($result);
     }
     return $object;
 }