Example #1
0
 public function getStatement()
 {
     $res = "";
     if (!empty($this->idPreuniGroup)) {
         $model = Statements::model()->find(" SpecialityID = {$this->idPreuniGroup}");
         if (!empty($model) && is_object($model)) {
             $res = CHtml::link("№" . $model->number, Yii::app()->createUrl("/preuniversity/statements/view", array("id" => $model->idStatement)));
         }
     }
     return $res;
 }
Example #2
0
 public function __construct($name, $raw = null)
 {
     parent::__construct($raw);
     $this->name = $name;
 }
Example #3
0
 protected function afterConstruct()
 {
     $criteria = new CDbCriteria();
     $criteria->select = 'max(idStatement) AS idStatement';
     $row = Statements::model()->find($criteria);
     $num = $row->idStatement;
     $this->number = str_pad($num + 1, 8, "0", STR_PAD_LEFT);
     //perent::afterConstruct();
 }
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Statements::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
 }