Esempio n. 1
0
 /**
  * Delete customer
  * @param $result
  * @return mixed
  */
 public function deleteCustomer($result)
 {
     // validate input
     if (!is_numeric($this->data->id)) {
         $result['error'] = "A valid id must be supplied";
         return $result;
     }
     $custMdl = new CustomerModel();
     $qresult = $custMdl->remove($this->data->id);
     if ($qresult === false) {
         $result['error'] = "Could not delete the customer";
     } else {
         $result['data'] = true;
         // log data
         Logger::write("Customer deleted with id:" . $this->data->id, "CUSTOMER");
     }
     return $result;
 }