当前位置: 首页>>代码示例>>PHP>>正文


PHP CActiveRecord::__construct方法代码示例

本文整理汇总了PHP中CActiveRecord::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::__construct方法的具体用法?PHP CActiveRecord::__construct怎么用?PHP CActiveRecord::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CActiveRecord的用法示例。


在下文中一共展示了CActiveRecord::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     // init options
     $this->typeOptions = array(self::TYPE_INDIVIDUAL => Yii::t('amo', 'individual'), self::TYPE_CONCESSIONAIRE => Yii::t('amo', 'concessionaire'), self::TYPE_DEALER => Yii::t('amo', 'dealer'), self::TYPE_GARAGE => Yii::t('amo', 'garage'), self::TYPE_ADMIN => Yii::t('amo', 'admin'));
     $this->statusOptions = array(self::STATUS_NOT_CONFIRMED => Yii::t('amo', 'Not confirmed'), self::STATUS_ACCOUNT_EMPTY => Yii::t('amo', 'Account not filled'), self::STATUS_ACTIVE => Yii::t('amo', 'Active'), self::STATUS_BLOCKED => Yii::t('amo', 'Blocked'));
 }
开发者ID:CHILMEX,项目名称:amocasion,代码行数:7,代码来源:User.php

示例2: __construct

 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     if (empty(CDao::$_dbConfig)) {
         CDao::$_dbConfig = dbConfig();
     }
 }
开发者ID:jackey,项目名称:sucelit,代码行数:7,代码来源:CDao.php

示例3: __construct

 public function __construct($scenario = 'insert', $nombreTabla = null)
 {
     $transac = Yii::app()->db->beginTransaction();
     try {
         if ($nombreTabla !== null) {
             $this->nombreTabla = $nombreTabla;
         } else {
             // Toma el valor del parametro
             $parametro = str_replace('/', '', Parametro::model()->getParametro('PERIODOCARGA', 'CARGA')->valoralfanumerico);
         }
         $this->nombreTabla = 'carga' . $parametro;
         if (Yii::app()->db->schema->getTable($this->nombreTabla, true) === null) {
             // Intentento copiar la tabla carga si no existe en la base de datos
             $gb = new Globalmodel();
             $gb->copiarTablaconPK('carga', $this->nombreTabla);
             // Intento copiar la tabla practicacarga
             $gb->copiarTablaconPK('practicacarga', 'practicacarga' . $parametro, array(array("origen" => 'carga', "destino" => 'carga' . $parametro)));
         }
         $transac->commit();
         parent::__construct($scenario);
     } catch (Exception $e) {
         $transac->rollback();
         throw new Exception("Error al generar estructura de carga");
     }
 }
开发者ID:juankie,项目名称:gestcb9git,代码行数:25,代码来源:Carga.php

示例4: __construct

 /**
  * Constructor override.
  */
 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     if ($scenario == 'search') {
         $this->setAttributes(array_fill_keys($this->attributeNames(), null), false);
     }
 }
开发者ID:shayanyi,项目名称:CRM,代码行数:10,代码来源:Fields.php

示例5: __construct

 public function __construct($scenario = 'insert')
 {
     $this->_authPath = Yii::app()->authManager->pathTable;
     $this->_authItem = Yii::app()->authManager->itemTable;
     $this->_authUser = Yii::app()->authManager->assignmentTable;
     $this->_authChild = Yii::app()->authManager->itemChildTable;
     parent::__construct($scenario);
 }
开发者ID:hotbaby,项目名称:yii-hrbac,代码行数:8,代码来源:HrbacItemModel.php

示例6: __construct

 public function __construct($tableName = '', $className = __CLASS__)
 {
     if ($tableName === null) {
         parent::__construct(null);
     } else {
         self::$tableName = $tableName;
     }
 }
开发者ID:FlynnFang,项目名称:cyfyy,代码行数:8,代码来源:BaseModel.php

示例7: __construct

 public function __construct($scenario = 'insert', $uid = null, $dbPersistentGridSettings = false)
 {
     if ($uid !== null) {
         $this->uid = $uid;
     }
     $this->dbPersistentGridSettings = $dbPersistentGridSettings;
     parent::__construct($scenario);
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:8,代码来源:Profile.php

示例8: __construct

 /**
  * Constructor
  *
  * @param string $scenario
  *
  * @return BaseRecord
  */
 public function __construct($scenario = 'insert')
 {
     // If Craft isn't installed, this model's table won't exist yet, so just create an instance of the class,
     // for use by the installer
     if ($scenario !== 'install') {
         parent::__construct($scenario);
     }
 }
开发者ID:vescoyez,项目名称:portfolio_v2,代码行数:15,代码来源:BaseRecord.php

示例9: __construct

 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     if (!self::$_isStart) {
         self::$_isStart = true;
         self::processModelRelation($this);
         self::$_isStart = false;
     }
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:9,代码来源:BaseActiveRecord.php

示例10: __construct

 /**
  * @param string $scenario
  * @param string $tableName
  */
 public function __construct($scenario = 'insert', $tableName = null)
 {
     if (!isset($tableName)) {
         //Yii::trace('sTableName missing.');
         throw new Exception('$tableName missing.');
     }
     $this->tableName = $tableName;
     parent::__construct($scenario);
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:13,代码来源:Dynamic_old.php

示例11: __construct

 public function __construct($table_name = '')
 {
     if ($table_name === null) {
         parent::__construct(null);
     } else {
         self::$tableName = $table_name;
         parent::__construct();
     }
 }
开发者ID:00606,项目名称:wechat,代码行数:9,代码来源:GiftCodeModel.php

示例12: __construct

 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     // init options
     $this->fuelOptions = array('' => Yii::t('amo', 'not specified'), self::FUEL_DIESEL => Yii::t('amo', 'diesel'), self::FUEL_GASOLINE => Yii::t('amo', 'gasoline'), self::FUEL_OTHER => Yii::t('amo', 'other'));
     $this->priceTypeOptions = array('' => Yii::t('amo', 'not specified'), self::PRICE_TYPE_TOTAL => Yii::t('amo', 'total'), self::PRICE_TYPE_FROM => Yii::t('amo', 'from'), self::PRICE_TYPE_MONTH => Yii::t('amo', 'month'), self::PRICE_TYPE_CONSULT => Yii::t('amo', 'consult'));
     $this->colorOptions = array('ffff00' => Yii::t('amo', 'Yellow'), '0099ff' => Yii::t('amo', 'Light blue'), '0000cc' => Yii::t('amo', 'Dark blue'), 'ffffff' => Yii::t('amo', 'White'), '993300' => Yii::t('amo', 'Deep red'), 'bbbbbb' => Yii::t('amo', 'Light grey'), '666666' => Yii::t('amo', 'Dark grey'), '663300' => Yii::t('amo', 'Brown'), 'ff6600' => Yii::t('amo', 'Orange'), '000000' => Yii::t('amo', 'Black'), 'cc9900' => Yii::t('amo', 'Golden'), 'ff0000' => Yii::t('amo', 'Red'), '33ff00' => Yii::t('amo', 'Light green'), '009900' => Yii::t('amo', 'Dark green'));
     asort($this->colorOptions);
     array_unshift($this->colorOptions, Yii::t('amo', 'not specified'));
 }
开发者ID:CHILMEX,项目名称:amocasion,代码行数:10,代码来源:Vehicle.php

示例13: __construct

 public function __construct($scenario = 'insert')
 {
     parent::__construct($scenario);
     //$defaultControllerName = get_class($this) . 'Controller';
     //echo $defaultControllerName . '-';
     //$defaultController = new $defaultControllerName($this->getEntityType());
     if ($this->module_name == null) {
         $this->module_name = $this->getEntityType();
     }
 }
开发者ID:Lucerin,项目名称:Yii-projects,代码行数:10,代码来源:CLBActiveRecord.php

示例14: __construct

 public function __construct($useLong = false, $scenario = 'insert')
 {
     if ($useLong === null) {
         $this->_useLong = false;
         parent::__construct(null);
     } else {
         $this->_useLong = $useLong;
         parent::__construct($scenario);
     }
 }
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:10,代码来源:CStubActiveRecord.php

示例15: __construct

 public function __construct($scenario = 'insert', $nombreTabla = null)
 {
     if ($nombreTabla !== null) {
         $this->nombreTabla = $nombreTabla;
     } else {
         // Toma el valor del parametro
         $this->nombreTabla = 'practicacarga' . str_replace('/', '', Parametro::model()->getParametro('PERIODOCARGA', 'CARGA')->valoralfanumerico);
     }
     // Validar existencia
     parent::__construct($scenario);
 }
开发者ID:juankie,项目名称:gestcb9git,代码行数:11,代码来源:Practicacarga.php


注:本文中的CActiveRecord::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。