public function addFead(Application_Model_Entity_Fead $fead) { $id = $this->urlExists($fead->getUrl()); if (!$id) { $this->_db->insert($this->_table, ['title' => $fead->getTitle(), 'url' => $fead->getUrl()]); $id = $this->_db->lastInsertId($this->_table); Application_Service_Fead::getInstance()->updateFead($fead->getUrl(), $id); } Application_Model_UserFeadRepository::getInstance()->add($id); return $id; }
public function update(Application_Model_Entity_Fead $fead) { $this->_db->update($this->_table, ['title' => $fead->getTitle(), 'order' => (int) $fead->getOrder(), 'folder' => (int) $fead->getFolder()], [$this->_db->quoteInto('feadid=?', $fead->getId()), $this->_db->quoteInto('userid=?', $this->_userId)]); }