Example #1
0
 /**
  * Get Performance
  *
  * @return array
  */
 public function get_performance($type = '')
 {
     $performance = array('reviews' => array(), 'comments' => array(), 'goals' => array());
     $results = erp_array_to_object(\WeDevs\ERP\HRM\Models\Performance::all()->toArray());
     if ($results) {
         foreach ($results as $key => $value) {
             if (isset($performance[$value->type])) {
                 $performance[$value->type][] = $value;
             }
         }
     }
     if (!empty($type) && isset($performance[$type])) {
         return $performance[$type];
     }
     return $performance;
 }
Example #2
0
 /**
  * Remove an Prformance
  *
  * @return void
  */
 public function employee_delete_performance()
 {
     $this->verify_nonce('wp-erp-hr-nonce');
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     \WeDevs\ERP\HRM\Models\Performance::find($id)->delete();
     $this->send_success();
 }