Exemplo n.º 1
0
 /**
  * Get dependents
  *
  * @return array
  */
 public function get_dependents()
 {
     return Dependents::where('employee_id', '=', $this->id)->get();
 }
Exemplo n.º 2
0
 /**
  * Delete a dependent
  *
  * @return void
  */
 public function employee_dependent_delete()
 {
     $this->verify_nonce('wp-erp-hr-nonce');
     // @TODO: check permission
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     if ($id) {
         Dependents::find($id)->delete();
     }
     $this->send_success();
 }