public function get() { if ($this->hasParameter("id")) { return array("data" => PartManager::getInstance()->getPart($this->getParameter("id"))->serialize()); } else { $filter = new ManagerFilter($this); $filter->setFilterCallback(array($this, "filterCallback")); return PartManager::getInstance()->getList($filter); } }
/** * (non-PHPdoc) * @see PartKeepr\Service.RestfulService::get() */ public function get() { if ($this->hasParameter("id")) { return array("data" => SystemNoticeManager::getInstance()->getEntity($this->getParameter("id"))->serialize()); } else { $parameters = new ManagerFilter($this); $parameters->setFilterCallback(array($this, "filterCallback")); return SystemNoticeManager::getInstance()->getList($parameters); } }
/** * (non-PHPdoc) * @see \PartKeepr\Service\RestfulService::get() */ public function get() { if ($this->hasParameter("id")) { $job = PrintingJobManager::getInstance()->getEntity($this->getParameter("id")); $this->checkPermission($job); return array("data" => $job->serialize()); } else { $filter = new ManagerFilter($this); $filter->setFilterCallback(array($this, "filterCallback")); return PrintingJobManager::getInstance()->getList($filter); } }
/** * Implements the get() call for the RestfulService. * * If the "id" parameter is passed, try to return the user by id. If not, * return a list. * * @see PartKeepr\Service.RestfulService::get() */ public function get() { if ($this->hasParameter("id")) { if (!SessionManager::getCurrentSession()->getUser()->isAdmin()) { throw new \Exception("Permission denied"); } return array("data" => UserManager::getInstance()->getUser($this->getParameter("id"))->serialize()); } else { $filter = new ManagerFilter($this); $filter->setFilterCallback(array($this, "filterCallback")); return UserManager::getInstance()->getList($filter); } }
/** * (non-PHPdoc) * @see PartKeepr\Service.RestfulService::get() */ public function get() { if ($this->hasParameter("id")) { return array("data" => StockManager::getInstance()->getEntity($this->getParameter("id"))->serialize()); } else { $parameters = new ManagerFilter($this); $parameters->setFilterField("name"); if ($this->hasParameter("part")) { $parameters->setFilterCallback(array($this, "filterCallback")); } return StockManager::getInstance()->getList($parameters); } }