Ejemplo n.º 1
0
 function get_grp_info($grp_cd)
 {
     $this->db->from('ASSET_GRP');
     $this->db->where('GRP_CODE', $grp_cd);
     $query = $this->db->get();
     if ($query->num_rows() == 1) {
         return $query->row();
     } else {
         //Get empty base parent object, as $employee_id is NOT an employee
         $grp_obj = parent::get_grp_info(-1);
         //$person_obj=$this->get_person_info(-1);
         //Get all the fields from employee table
         $fields = $this->db->list_fields('ASSET_GRP');
         //append those fields to base parent object, we we have a complete empty object
         foreach ($fields as $field) {
             $grp_obj->{$field} = '';
         }
         return $grp_obj;
     }
 }