Esempio n. 1
0
 public function destroy()
 {
     $id = $this->request->get('id');
     $company = $this->companyModel->getByID($id);
     if ($company) {
         if ($company->hasRelations()) {
             $this->server->sendConflict(HLang::get(Lang::alert_cant_delete_company__in_relation));
         }
         $company->getItem()->delete();
         $this->server->sendOK();
     } else {
         $this->server->sendNotFound();
     }
 }
Esempio n. 2
0
 /**
  * @return Company
  */
 public function getProvider()
 {
     return $this->companyModel->getByID($this->getItem()->provider);
 }