コード例 #1
0
ファイル: MySQL.php プロジェクト: davewid/cactus
 /**
  * Saves an entity.
  *
  * @param \Cactus\Entity $entity  The entity to save
  * @return mixed                  create = array($id, $affected) | update = $affected
  */
 public function save(\Cactus\Entity &$entity)
 {
     return $entity->isNew() ? $this->create($entity) : $this->update($entity);
 }
コード例 #2
0
ファイル: Mapper.php プロジェクト: davewid/cactus
 /**
  * Prepares the data to return to the data store (as strings).
  *
  * @param  \Cactus\Entity $entity The entity to prepare
  * @return array                  The modified/filtered/reverted data...
  */
 protected function prepareData(\Cactus\Entity $entity)
 {
     $data = $this->filter($entity->getModifiedData());
     return $entity->revert($data);
 }