示例#1
0
文件: Entity.php 项目: aazon/sfm
 /**
  * @return $this
  * @throws SFM_Exception
  */
 public function save()
 {
     $id = $this->mapper->saveEntity($this, $this->simpleValues);
     if ($this->isDummy()) {
         $this->setId($id);
     }
     //Entity should not be dirty any more
     $this->initialSimpleValues = $this->simpleValues;
     return $this;
 }
示例#2
0
文件: List.php 项目: aazon/sfm
 /**
  * @param array $arrIds
  * @param bool $keepMatches
  * @return SFM_List
  */
 public function filterById(array $arrIds, $keepMatches = true)
 {
     $arrIds = (array) $arrIds;
     $list = $this->mapper->createList();
     foreach ($this->arrEntities as $eTestEntity) {
         if ($keepMatches xor !in_array($eTestEntity->getId(), $arrIds)) {
             $list->append($eTestEntity);
         }
     }
     return $list;
 }