/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Vehiculo the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Vehiculo::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'La página solicitada no existe.');
     }
     return $model;
 }
示例#2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * 
  * @param integer $id
  *        	the ID of the model to be loaded
  * @return Vehiculo the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Vehiculo::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#3
0
 /**
  * getNumConYNomApeCond
  * Obtiene Número de Control y Nombre completo del Conductor
  * @param $modelDV Objeto que envía la información requerida
  * @return Objeto $modelDV Objeto con los datos llenos.
  **/
 public static function getNumConYNomApeCond($modelDV)
 {
     $modelDV->numeroControl = Vehiculo::model()->findByPk($modelDV->numeroControl)->veh_num_con;
     $conPer = Conductor::model()->with('idPersona')->together()->findByPk($modelDV->nomConductor);
     $modelDV->nomConductor = $conPer->idPersona->per_nom . " " . $conPer->idPersona->per_ape;
     return $modelDV;
 }