Beispiel #1
0
 /**
  * Add tag only if it is not existing already
  * 
  * (non-PHPdoc)
  * @see \TYPO3\CMS\Extbase\Persistence\Repository::add()
  */
 public function add($tag)
 {
     $existingTag = $this->findOneByName($tag->getName());
     if ($existingTag === null) {
         parent::add($tag);
     }
 }
Beispiel #2
0
 /**
  * This is a patch for TYPO3 6.2 - can be removed for
  * TYPO3 7.0 - see parents class method
  *
  * @param int $identifier
  * @param bool $ignoreEnableFields
  * @return Tx_Yag_Domain_Model_Album
  */
 public function findByUid($identifier, $ignoreEnableFields = false)
 {
     if (Tx_PtExtbase_Div::isMinTypo3Version(7)) {
         return parent::findByUid($identifier);
     }
     if ($this->session->hasIdentifier($identifier, $this->objectType)) {
         $object = $this->session->getObjectByIdentifier($identifier, $this->objectType);
     } else {
         $query = $this->createQuery();
         $query->getQuerySettings()->setRespectStoragePage(false);
         $query->getQuerySettings()->setRespectSysLanguage(false);
         $query->getQuerySettings()->setIgnoreEnableFields($ignoreEnableFields);
         $object = $query->matching($query->equals('uid', $identifier))->execute()->getFirst();
     }
     return $object;
 }