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