Esempio n. 1
0
 public function fetchByIdRH($id_rh)
 {
     $row = $this->select(array('id_rh' => $id_rh, 'activo' => 'True'))->current();
     if (!$row) {
         $entity = new Entity\Empleado(array('id' => 0));
     } else {
         $entity = new Entity\Empleado(array('id' => $row["id"], 'id_tipo_empleado' => $row["id_tipo_empleado"], 'id_unidad' => $row["id_unidad"], 'id_mitrol' => $row["id_mitrol"], 'id_rh' => $row["id_rh"], 'nombre' => $row["nombre"], 'fecha_ingreso' => $row["fecha_ingreso"]));
     }
     return $entity->toArray();
 }
Esempio n. 2
0
 public function fetchByTipo($tipo)
 {
     $row = $this->select(array('tipo' => $tipo))->current();
     if (!$row) {
         $entity = new Entity\Empleado(array('id' => 0));
     } else {
         $entity = new Entity\Empleado(array('id' => $row["id"], 'id_unidad' => $row["id_unidad"], 'tipo' => $row["tipo"], 'descripcion' => $row["descripcion"]));
     }
     return $entity->toArray();
 }