當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ActiveRecord::populateRecord方法代碼示例

本文整理匯總了PHP中yii\db\ActiveRecord::populateRecord方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveRecord::populateRecord方法的具體用法?PHP ActiveRecord::populateRecord怎麽用?PHP ActiveRecord::populateRecord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\db\ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::populateRecord方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadVersion

 /**
  * @param integer $version_id
  * @return ActiveRecord
  */
 public function loadVersion($version_id)
 {
     /** @var ActiveRecord $owner */
     $owner = $this->owner;
     $modelClass = get_class($owner);
     $row = (new Query())->select('row_data')->from($this->auditTableName)->where(array_fill_keys($owner->getDb()->getTableSchema($this->auditTableName)->primaryKey, $version_id))->one($owner->getDb());
     return ActiveRecord::populateRecord(new $modelClass(), json_decode($row));
 }
開發者ID:nineinchnick,項目名稱:yii2-audit,代碼行數:12,代碼來源:TrackableBehavior.php

示例2: populateRecord

 /**
  * @param DynamicActiveRecord $record
  * @param array $row
  *
  * @throws Exception
  */
 public static function populateRecord($record, $row)
 {
     $dynCol = static::dynamicColumn();
     if (isset($row[$dynCol])) {
         $record->_dynamicAttributes = static::dynColDecode($row[$dynCol]);
     }
     parent::populateRecord($record, $row);
 }
開發者ID:nineinchnick,項目名稱:yii2-dynamic-ar,代碼行數:14,代碼來源:DynamicActiveRecord.php

示例3: populateRecord

 /**
  * @inheritdoc
  */
 public static function populateRecord($record, $row)
 {
     parent::populateRecord($record, $row);
     $record->value = unserialize($record->value);
 }
開發者ID:jlorente,項目名稱:yii2-config-variables,代碼行數:8,代碼來源:Variable.php

示例4: populateRecord

 /**
  * @inheritdoc
  */
 public static function populateRecord($record, $row)
 {
     foreach (['user_id', 'contact_id'] as $name) {
         if (isset($row[$name])) {
             $row[$name] = intval($row[$name]);
         }
     }
     parent::populateRecord($record, $row);
 }
開發者ID:bubasuma,項目名稱:yii2-simplechat,代碼行數:12,代碼來源:Conversation.php

示例5: populateRecord

 public static function populateRecord($record, $row)
 {
     $record->_custom_attributes = array_keys($row);
     parent::populateRecord($record, $row);
 }
開發者ID:VEKsoftware,項目名稱:yii2-report-manager,代碼行數:5,代碼來源:ClassSearch.php


注:本文中的yii\db\ActiveRecord::populateRecord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。