Example #1
0
 /**
  * Reads a record from the database by UID (from this mapper's table). Also
  * hidden records will be retrieved.
  *
  * @throws tx_oelib_Exception_NotFound if there is no record in the DB
  *                                     with the UID $uid
  *
  * @param int $uid
  *        the UID of the record to retrieve, must be > 0
  *
  * @return array the record from the database, will not be empty
  */
 protected function retrieveRecordByUid($uid)
 {
     $authentication = $this->getBackEndUserAuthentication();
     if (Tx_Oelib_BackEndLoginManager::getInstance()->isLoggedIn() && (int) $authentication->user['uid'] === $uid) {
         $data = $authentication->user;
     } else {
         $data = parent::retrieveRecordByUid($uid);
     }
     return $data;
 }
Example #2
0
 /**
  * Saves the related models of a comma-separated and a regular m:n relation.
  *
  * @param Tx_Oelib_List<Tx_Oelib_Model> $list the list of models to save
  * @param Tx_Oelib_DataMapper $mapper the mapper to use for saving
  *
  * @return void
  */
 private function saveManyToManyAndCommaSeparatedRelatedModels(Tx_Oelib_List $list, Tx_Oelib_DataMapper $mapper)
 {
     /** @var Tx_Oelib_Model $model */
     foreach ($list as $model) {
         $mapper->save($model);
     }
 }
Example #3
0
 /**
  * Looks up a model in the cache by key.
  *
  * When this function reports "no match", the model could still exist in the
  * database, though.
  *
  * @throws tx_oelib_Exception_NotFound if there is no match in the cache yet
  *
  * @param string $key an existing key, must not be empty
  * @param string $value
  *        the value for the key of the model to find, must not be empty
  *
  * @return Tx_Oelib_Model the cached model
  */
 public function findOneByKeyFromCache($key, $value)
 {
     return parent::findOneByKeyFromCache($key, $value);
 }