예제 #1
0
 public function addRelation()
 {
     $id_agreement = $this->request->getUInt('id_agreement');
     $id_relation = $this->request->getUInt('id_relation');
     $agreement = $this->agreementModel->getByID($id_agreement);
     if (!$agreement) {
         $this->server->sendNotFound();
     }
     if (!$agreement->addRelation($id_relation)) {
         $this->server->sendServerError('Invalid relation');
     }
     $this->server->sendData($agreement->toJSON());
 }
예제 #2
0
파일: Company.php 프로젝트: JoniJnm/dokify2
 public function __construct($item)
 {
     parent::__construct($item);
     $this->agreementModel = AgreementModel::getInstance();
 }