/** * @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; }
/** * @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; }