本文整理汇总了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'));
}
示例2: __construct
public function __construct($scenario = 'insert')
{
parent::__construct($scenario);
if (empty(CDao::$_dbConfig)) {
CDao::$_dbConfig = dbConfig();
}
}
示例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");
}
}
示例4: __construct
/**
* Constructor override.
*/
public function __construct($scenario = 'insert')
{
parent::__construct($scenario);
if ($scenario == 'search') {
$this->setAttributes(array_fill_keys($this->attributeNames(), null), false);
}
}
示例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);
}
示例6: __construct
public function __construct($tableName = '', $className = __CLASS__)
{
if ($tableName === null) {
parent::__construct(null);
} else {
self::$tableName = $tableName;
}
}
示例7: __construct
public function __construct($scenario = 'insert', $uid = null, $dbPersistentGridSettings = false)
{
if ($uid !== null) {
$this->uid = $uid;
}
$this->dbPersistentGridSettings = $dbPersistentGridSettings;
parent::__construct($scenario);
}
示例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);
}
}
示例9: __construct
public function __construct($scenario = 'insert')
{
parent::__construct($scenario);
if (!self::$_isStart) {
self::$_isStart = true;
self::processModelRelation($this);
self::$_isStart = false;
}
}
示例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);
}
示例11: __construct
public function __construct($table_name = '')
{
if ($table_name === null) {
parent::__construct(null);
} else {
self::$tableName = $table_name;
parent::__construct();
}
}
示例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'));
}
示例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();
}
}
示例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);
}
}
示例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);
}