本文整理汇总了PHP中BaseModel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::__construct方法的具体用法?PHP BaseModel::__construct怎么用?PHP BaseModel::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModel
的用法示例。
在下文中一共展示了BaseModel::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new Folder Sharing Info instance
*
* @param array $data
*/
public function __construct(array $data)
{
parent::__construct($data);
$this->read_only = $this->getDataProperty('read_only');
$this->shared_folder_id = $this->getDataProperty('shared_folder_id');
$this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->mapping->table = 'accounts';
$this->bindPhotoModel();
$this->bindAddressModel();
}
示例3: __construct
public function __construct($params = null)
{
parent::__construct();
if (isset($params['config'])) {
$this->config = $params['config'];
}
$this->scriptsDir = sprintf('%s/upgrade', $this->config->paths->configs);
$this->systems = array('readme', 'base', 'db', 'fs');
$defaults = $this->config->defaults;
$this->currentCodeVersion = $defaults->currentCodeVersion;
$currentParts = explode('.', $this->currentCodeVersion);
$this->currentCodeMajorVersion = $currentParts[0];
$this->currentCodeMinorVersion = $currentParts[1];
$this->currentCodeTrivialVersion = $currentParts[2];
$siteConfig = $this->config->site;
if (isset($siteConfig->lastCodeVersion) && !empty($siteConfig->lastCodeVersion)) {
$this->lastCodeVersion = $siteConfig->lastCodeVersion;
} else {
$this->lastCodeVersion = $defaults->lastCodeVersion;
}
$lastParts = explode('.', $this->lastCodeVersion);
$this->lastCodeMajorVersion = $lastParts[0];
$this->lastCodeMinorVersion = $lastParts[1];
$this->lastCodeTrivialVersion = $lastParts[2];
}
示例4: __construct
public function __construct(array $attributes = array())
{
$this->detectInformation();
// Customize Rule
parent::__construct($attributes);
// TODO: Change the autogenerated stub
}
示例5: foreach
/**
* 获取分表中的表名,获取数据库抽象类对象,获取Memcached抽象对象
* @param $pid
*/
function __construct($pid = '', $persister = false)
{
parent::__construct($pid);
$this->dbConfig = BaseModel::getConfigVar('database');
//v($this->dbConfig);
$this->setTable();
$dbName = "default";
$child_classname = get_class($this);
if (isset($this->dbConfig['config_map_class'])) {
foreach ($this->dbConfig['config_map_class'] as $key => $row) {
if (in_array($child_classname, $row)) {
$dbName = $key;
break;
}
}
}
$this->dbName = $dbName;
//Slave数据库预连接
if (empty($this->slaveDB)) {
$this->slaveDB = $this->dbConnect($dbName, $persister);
}
//var_dump($this->slaveDB);
if (empty($this->masterDB)) {
$this->masterDB = $this->dbMasterConnect($dbName, $persister);
//Master数据库预连接
}
}
示例6:
function __construct(DibiConnection $connection, ICacheStorage $cache, WidgetParamModel $widgetParamModel)
{
parent::__construct($connection, $cache);
$this->table = 'widget';
$this->widgetParamModel = $widgetParamModel;
$this->__cronDelete();
}
示例7: __construct
public function __construct($id = -1)
{
parent::__construct();
$q = "SELECT * FROM BRDRequirements WHERE id = {$id}";
$db = new Dbase();
$res = $db->executeQuery($q);
if ($res && $res->num_rows > 0) {
if ($row = $res->fetch_assoc()) {
$this->id = $row['id'];
$this->BRD_ref_number = $row['BRD_ref_number'];
$this->BRD_date = $row['BRD_date'];
$this->approved = $row['approved'];
$this->approved_by = $row['approved_by'];
$this->approval_date = $row['approval_date'];
$this->stakeholders = $row['stakeholders'];
$this->stakeholder_BU = $row['stakeholder_BU'];
$this->expected_impact_BU = $row['expected_impact_BU'];
$this->stakeholder_approved = $row['stakeholder_approved'];
$this->stk_app_date = $row['stk_app_date'];
$this->responsible = $row['responsible'];
$this->accountable = $row['accountable'];
$this->consulted = $row['consulted'];
$this->informed = $row['informed'];
}
}
$res->free();
}
示例8: __construct
public function __construct(ConfigurationModel $config, NameModel $nameModel, Library $library)
{
parent::__construct($config);
$this->nameModel = $nameModel;
$this->siteId = $config->getSiteId();
$this->library = $library;
}
示例9: __construct
public function __construct($attributes = null)
{
if (is_array($attributes)) {
parent::__construct($attributes);
}
$this->validators = array('validate_username', 'validate_password');
}
示例10: __construct
public function __construct($id = -1)
{
parent::__construct();
$q = "SELECT * FROM RiskMitigationPlan WHERE id = {$id}";
$db = new Dbase();
$res = $db->executeQuery($q);
if ($res && $res->num_rows > 0) {
if ($row = $res->fetch_assoc()) {
$this->id = $row['id'];
$this->prelaunch_checklist = $row['prelaunch_checklist'];
$this->UAT_required = $row['UAT_required'];
$this->UAT_conducted_by = $row['UAT_conducted_by'];
$this->UAT_date = $row['UAT_date'];
$this->vetted_by_stakeholders = $row['vetted_by_stakeholders'];
$this->feedback_taken_from = $row['feedback_taken_from'];
$this->feedback = $row['feedback'];
$this->feedback_incorporated = $row['feedback_incorporated'];
$this->feedback_incorporation_date = $row['feedback_incorporation_date'];
$this->final_UAT = $row['final_UAT'];
$this->final_UAT_conducted_by = $row['final_UAT_conducted_by'];
$this->final_sign_off = $row['final_sign_off'];
$this->GTM_sign_off = $row['GTM_sign_off'];
$this->SVP_sign_off = $row['SVP_sign_off'];
}
}
$res->free();
}
示例11: __construct
/**
* {@inheritdoc}
*/
public function __construct($configuration)
{
parent::__construct($configuration);
$this->person = PersonReferenceModel::create($configuration['person']);
$this->list = ListReferenceModel::create($configuration['list']);
$this->alreadyMember = $configuration['already_member'];
}
示例12: __construct
/**
* Create a new CopyReference instance
*
* @param array $data
*/
public function __construct(array $data)
{
parent::__construct($data);
$this->expires = new DateTime($this->getDataProperty('expires'));
$this->reference = $this->getDataProperty('copy_reference');
$this->setMetadata();
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->apiKey = Yii::app()->params['baiduPushApiKey'];
$this->secretKey = Yii::app()->params['baiduPushSecretKey'];
$this->channel = new Channel($this->apiKey, $this->secretKey);
}
示例14: __construct
public function __construct($pixie)
{
parent::__construct($pixie);
$this->created_at = date('Y-m-d H:i:s');
$this->status = self::STATUS_NEW;
$this->amount = 0;
}
示例15: __construct
public function __construct($params = null)
{
parent::__construct();
if (isset($params['utility'])) {
$this->utility = $params['utility'];
} else {
$this->utility = new Utility();
}
if (isset($params['url'])) {
$this->url = $params['url'];
} else {
$this->url = new Url();
}
if (isset($params['image'])) {
$this->image = $params['image'];
} else {
$this->image = getImage();
}
if (isset($params['user'])) {
$this->user = $params['user'];
} else {
$this->user = new User();
}
if (isset($params['config'])) {
$this->config = $params['config'];
}
}