Example #1
0
File: Entity.php Project: 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;
 }
Example #2
0
File: List.php Project: 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;
 }