function saveAction() { $id = (int) $this->getRequest()->getParam('save'); $entity = new Elite_Vaf_Model_Level($this->getEntity()->getType(), $id); $entity->setTitle($this->getRequest()->getParam('title')); $entity->save($this->requestLevels()); if ($this->getRequest()->isXmlHttpRequest()) { echo $entity->getId(); exit; } $this->doSave(); }
function listInUse(Elite_Vaf_Model_Level $entity, $parents = array(), $product_id = 0) { unset($parents[$entity->getType()]); if (isset($this->objs_in_use[$entity->getType()][$entity->getId()])) { return $this->objs_in_use[$entity->getType()][$entity->getId()]; } $result = $this->doListInUse($entity, $parents, $product_id); $this->objs_in_use[$entity->getType()][$entity->getId()] = array(); while ($row = $result->fetchObject()) { $obj = $entity->createEntity($entity->getType(), 0); $obj->setId($row->id); $obj->setTitle($row->title); array_push($this->objs_in_use[$entity->getType()][$entity->getId()], $obj); } return $this->objs_in_use[$entity->getType()][$entity->getId()]; }