Ejemplo n.º 1
0
 public static function PrepareTechnicianObject($dataPost, $oldObject = null)
 {
     if (!is_null($oldObject)) {
         $technician = $oldObject;
     } else {
         $technician = new \Applications\PMTool\Models\Dao\Technician();
     }
     $technician->setTechnician_id($dataPost["technician_id"]);
     $technician->setTechnician_name($dataPost["technician_name"]);
     $technician->setTechnician_phone(!array_key_exists('technician_phone', $dataPost) ? "" : $dataPost["technician_phone"]);
     $technician->setTechnician_active(!array_key_exists('technician_active', $dataPost) ? "" : $dataPost["technician_active"]);
     return $technician;
 }
 private static function _PrepareManyTechnicianObjects($dataPost)
 {
     $technicians = array();
     $technician_names = \Applications\PMTool\Helpers\CommonHelper::StringToArray("\n", $dataPost["names"]);
     foreach ($technician_names as $name) {
         $technician = new \Applications\PMTool\Models\Dao\Technician();
         $technician->setPm_id($dataPost["pm_id"]);
         $technician->setTechnician_name($name);
         $technician->setTechnician_active($dataPost["active"]);
         array_push($technicians, $technician);
     }
     return $technicians;
 }