/** * Loads a list of static routes for the specicifies parameters, returns an array of Element_Note elements * * @return array */ public function load() { $notesData = $this->db->fetchCol("SELECT id FROM notes" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables()); $notes = array(); foreach ($notesData as $noteData) { if ($note = Element_Note::getById($noteData)) { $notes[] = $note; } } $this->model->setNotes($notes); return $notes; }
public function noteAddAction() { $note = new Element_Note(); $note->setCid((int) $this->_getParam("cid")); $note->setCtype($this->_getParam("ctype")); $note->setDate(time()); $note->setTitle($this->_getParam("title")); $note->setDescription($this->_getParam("description")); $note->setType($this->_getParam("type")); $note->save(); $this->_helper->json(array("success" => true)); }