コード例 #1
0
ファイル: TypeEntity.php プロジェクト: blancomen/blanco3
 /**
  * @param Entity $value
  * @return array
  */
 public function export($value)
 {
     if (!$value instanceof Entity) {
         return [];
     }
     return $value->export();
 }
コード例 #2
0
 /**
  * @param Entity $Entity
  * @return int
  */
 public function save(Entity $Entity)
 {
     if (!$Entity->getId()) {
         $Entity->setId($this->getNextId());
     }
     $this->getRepositoryDriver()->set($Entity->getId(), $Entity->serialize());
     $this->getCache()->set($Entity->getId(), $Entity);
     return $Entity->getId();
 }