Exemplo n.º 1
0
 /**
  * After finding a user and getting a valid result
  * store the old attributes in $this->_oldAttributes
  * @return parent::afterFind();
  */
 public function afterFind()
 {
     if ($this !== NULL) {
         $this->_oldAttributes = $this->attributes;
     }
     return parent::afterFind();
 }
Exemplo n.º 2
0
 public function formattedDate()
 {
     // From: http://stackoverflow.com/questions/6811706/yii-how-to-change-datetime-format-displayed-on-the-view
     // convert to display format
     return DateTime::createFromFormat('Y-m-d H:i:s', $this->date_entered)->format('M. d, Y');
     parent::afterFind();
 }
Exemplo n.º 3
0
 protected function afterFind()
 {
     parent::afterFind();
     if (!empty($this->dt_deadline)) {
         $this->dt_deadline = date('d.m.Y', strtotime($this->dt_deadline));
     }
 }
Exemplo n.º 4
0
 protected function afterFind()
 {
     if (!empty($this->SpecialityID)) {
         $ps = Specialities::model()->findByPk($this->SpecialityID);
         if ($ps) {
             $this->FacultetID = $ps->facultet->idFacultet;
             $this->EducationFormID = $ps->eduform->idPersonEducationForm;
         }
     }
     if (isset($this->created)) {
         $this->created = date("d.m.Y", strtotime($this->created));
     }
     if (isset($this->updated)) {
         $this->updated = date("d.m.Y", strtotime($this->updated));
     }
     if (isset($this->SubjectsDate1)) {
         $this->SubjectsDate1 = date("d.m.Y", strtotime($this->SubjectsDate1));
     }
     if (isset($this->SubjectsDate2)) {
         $this->SubjectsDate2 = date("d.m.Y", strtotime($this->SubjectsDate2));
     }
     if (isset($this->SubjectsDate3)) {
         $this->SubjectsDate3 = date("d.m.Y", strtotime($this->SubjectsDate3));
     }
     return parent::afterFind();
 }
Exemplo n.º 5
0
 protected function afterFind()
 {
     if (self::model()->scenario != 'nolink') {
         $this->link = UtilModel::urlToLink($this->link);
     }
     parent::afterFind();
 }
Exemplo n.º 6
0
 public function afterFind()
 {
     parent::afterFind();
     if (!empty($this->profile_cache)) {
         $this->_profileCache = (object) unserialize($this->profile_cache);
     }
 }
Exemplo n.º 7
0
 protected function afterFind()
 {
     if (!$this->textarea) {
         $this->info = $this->unparse($this->info);
     }
     parent::afterFind();
 }
Exemplo n.º 8
0
 protected function afterFind()
 {
     if ($this->templatePath && file_exists($this->templatePath)) {
         $this->htmlTemplate = file_get_contents($this->templatePath);
     }
     parent::afterFind();
 }
Exemplo n.º 9
0
 protected function afterFind()
 {
     if (!empty($this->params)) {
         $this->params = json_decode($this->params);
     }
     parent::afterFind();
 }
Exemplo n.º 10
0
 /**
  * After Find
  */
 public function afterFind()
 {
     foreach ($this->encrypt as $key) {
         $this->{$key} = $this->encryptDecrypt($this->{$key}, 'decrypt');
     }
     parent::afterFind();
 }
 /**
  * afterFind
  */
 protected function afterFind()
 {
     $this->description = UtilModel::urlToLink($this->description);
     $this->dataRequired = UtilModel::urlToLink($this->dataRequired);
     $this->expertiseRequired = UtilModel::urlToLink($this->expertiseRequired);
     $this->reference = UtilModel::urlToLink($this->reference);
     parent::afterFind();
 }
Exemplo n.º 12
0
 public function afterFind()
 {
     if ($this->dateDBformat) {
         $this->dateDBformat = false;
         $this->date = date(Yii::app()->locale->getDateFormat('phpshort'), strtotime($this->date));
     }
     return parent::afterFind();
 }
Exemplo n.º 13
0
        public function afterFind()
        {
            $dateformat = Yii::app()->controller->cJuiDatePickerViewFormat;
            $this->paid_date = $this->getDisplayPayment_at();
            if(empty($this->paid_date)) $this->paid_date = date($dateformat);

            parent::afterFind();
        }
 protected function afterFind()
 {
     $controller = Yii::app()->controller->id;
     if ($controller == 'site' && Yii::app()->language == 'en') {
         $this->name = $this->name_en;
         $this->description = $this->description_en;
     }
     return parent::afterFind();
 }
Exemplo n.º 15
0
 public function afterFind()
 {
     // Формируем массив
     $this->speciality = array();
     $psb = BasespecialityRelation::model()->findAll("`PersonBaseSpecialityID` = {$this->idPersonBaseSpeciality}");
     foreach ($psb as $item) {
         $this->speciality[] = $item->SpecialityID;
     }
     return parent::afterFind();
 }
Exemplo n.º 16
0
 protected function afterFind()
 {
     if ($this->timeFrom) {
         $this->timeFrom = date("H:i", strtotime($this->timeFrom));
     }
     if ($this->timeTo) {
         $this->timeTo = date("H:i", strtotime($this->timeTo));
     }
     parent::afterFind();
 }
Exemplo n.º 17
0
 protected function afterFind()
 {
     $this->_prepareDateAttributes(APP_DB_TIMESTAMP_FORMAT, APP_DATE_FORMAT);
     foreach ($this->_getCastAttributeTypes() as $key => $type) {
         $value = $this->getAttribute($key);
         settype($value, $type);
         $this->setAttribute($key, $value);
     }
     parent::afterFind();
 }
Exemplo n.º 18
0
        public function afterfind()
        {
//           $dateformat = Yii::app()->controller->cJuiDatePickerViewFormat;
//           $this->date = $this->getDisplaydate();
//           if(empty($this->date)) $this->date = date($dateformat);
          
           $dateformat = Yii::app()->controller->boosterTbDateRangePickerFormatHMS;
           $this->updated_at = $this->getUpdated_at();
           if(empty($this->updated_at)) $this->updated_at = date($dateformat);
           parent::afterFind();
        }
Exemplo n.º 19
0
 protected function afterFind()
 {
     parent::afterFind();
     if (in_array($this->type, array(self::TYPE_FIXEDARRAY, self::TYPE_DYNAMICARRAY, self::TYPE_TWOPOWARRAY))) {
         $this->value = json_decode($this->value, true);
         // Так нельзя, придется править вывод списка в админке
         // $this->example = json_decode($this->example, true);
     }
     // Возвращаем именно тот тип данных, в котором хранится конфиг
     $this->checkReturnValue();
 }
Exemplo n.º 20
0
 protected function afterFind()
 {
     parent::afterFind();
     if (self::DISABLED == $this->status) {
         $this->status = self::DISABLED;
     } else {
         if (self::ACTIVE == $this->status) {
             $this->status = self::ACTIVE;
         } else {
             $this->status = null;
         }
     }
 }
Exemplo n.º 21
0
 public function afterFind()
 {
     // MSSQL delivers hex data
     $sDatabasetype = Yii::app()->db->getDriverName();
     if ($sDatabasetype == 'sqlsrv' || $sDatabasetype == 'mssql' || $sDatabasetype == 'dblib') {
         $this->data = $this->hexToStr($this->data);
     }
     // Postgres delivers a stream pointer
     if (gettype($this->data) == 'resource') {
         $this->data = stream_get_contents($this->data, -1, 0);
     }
     return parent::afterFind();
 }
Exemplo n.º 22
0
 public function afterFind()
 {
     $dateformat = Yii::app()->controller->cJuiDatePickerViewFormat;
     $this->acnt_date = $this->getDisplayAcnt_date();
     if(empty($this->acnt_date)) $this->acnt_date = date($dateformat);
     if(strtolower($this->accounttype) === strtolower(Helper::CONST_Receivables))
     {
         if(!empty($this->orders)) $this->order_or_ot_id = $this->orders[0]->id;
     }
     if(strtolower($this->accounttype) === strtolower(Helper::CONST_Payables))
     {
         if(!empty($this->ordertasks)) $this->order_or_ot_id = $this->ordertasks[0]->id;
     }
     parent::afterFind();
 }
Exemplo n.º 23
0
 public function afterFind()
 {
     foreach (Yii::app()->languageManager->languages as $language => $fullLanguage) {
         if ($language === Yii::app()->sourceLanguage) {
             $suffix = '';
         } else {
             $suffix = '_' . $language;
         }
         $alias = CmsAlias::model()->multilang()->findByPk($this->alias->id);
         $this->{'title' . $suffix} = $alias->{'title' . $suffix};
         if ($language == Yii::app()->language) {
             $this->title = $alias->{'title' . $suffix};
         }
     }
     return parent::afterFind();
 }
Exemplo n.º 24
0
 public function afterFind()
 {
     $dateformat = Yii::app()->controller->cJuiDatePickerViewFormat;
     $this->payment_at = $this->getDisplayPayment_at();
     if(empty($this->payment_at)) $this->payment_at = date($dateformat);
     if(strtolower($this->direction) === strtolower(Helper::CONST_Inwards))
     {
         if(!empty($this->order)) $this->order_or_ot_id = $this->order->id;
     }
     if(strtolower($this->direction) === strtolower(Helper::CONST_Outwards))
     {
         if(!empty($this->ordertask)) $this->order_or_ot_id = $this->ordertask->id;
     }
     $this->details = str_replace(':', '', $this->details);
     parent::afterFind();
 }
Exemplo n.º 25
0
 public function afterFind()
 {
     if (isset($this->getOwner()->foco_fetal)) {
         if ($this->getOwner()->foco_fetal == 0) {
             $this->getOwner()->foco_fetal = "+";
         } else {
             $this->getOwner()->foco_fetal = "-";
         }
     }
     if (isset($this->getOwner()->edemas)) {
         if ($this->getOwner()->edemas == 0) {
             $this->getOwner()->edemas = "Si";
         } else {
             $this->getOwner()->edemas = "No";
         }
     }
     parent::afterFind();
 }
Exemplo n.º 26
0
 public function afterFind()
 {
     parent::afterFind();
 }
Exemplo n.º 27
0
 public function afterFind()
 {
     $this->_fechaCompraDate = DateTime::createFromFormat('Y-m-d H:i:s', $this->fechaCompra);
     $this->_fechaEntregaDate = DateTime::createFromFormat('Y-m-d H:i:s', $this->fechaEntrega);
     return parent::afterFind();
 }
Exemplo n.º 28
0
 public function afterFind()
 {
     $this->dari = !is_null($this->dari) ? date_format(date_create_from_format('Y-m-d H:i:s', $this->dari), 'd-m-Y H:i') : '';
     $this->sampai = !is_null($this->sampai) ? date_format(date_create_from_format('Y-m-d H:i:s', $this->sampai), 'd-m-Y H:i') : '';
     return parent::afterFind();
 }
Exemplo n.º 29
0
 /**
  * This is invoked when a record is populated with data from a find() call.
  */
 protected function afterFind()
 {
     parent::afterFind();
     $this->_oldTags = $this->tags;
 }
Exemplo n.º 30
0
 protected function afterFind()
 {
     parent::afterFind();
     // TODO: Change the autogenerated stub
     //替换掉ubb
     $this->content = preg_replace("/\\[[^\\]]*\\].*?\\[\\/[^\\]]*\\]/", "", $this->content);
 }