本文整理汇总了PHP中ActiveRecord::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::__construct方法的具体用法?PHP ActiveRecord::__construct怎么用?PHP ActiveRecord::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::__construct方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct()
{
// Call the parent constructor
parent::__construct('account_info', DB_DEFAULT);
// Set the relationships
$this->HasOne('User');
// Set the Required
$this->SetRequired(array('user_id', 'name'));
}
示例2:
function __construct()
{
// Call the parent constructor
parent::__construct('answers', DB_DEFAULT);
// Set the relationships
$this->HasMany('Category', 'AnswerCategory');
// Set the Required
$this->SetRequired(array('user_id', 'question_id', 'question', 'date_asked'));
}
示例3: __construct
/**
* The constructor of Model class
*
* @param mixed $data Data for filling the model
*
* @return void
*/
public function __construct($data = null)
{
$this->_setUp();
$this->setUpData($data);
parent::__construct();
$this->_loadRelations();
$this->_oldPrimaryKey = array();
$this->_savePrimaryKey();
}
示例4:
function __construct()
{
// Call the parent constructor
parent::__construct('users', DB_DEFAULT);
// Set the relationships
$this->HasOne('AccountInfo');
$this->HasMany('Category');
// Set the Required
$this->SetRequired(array('username', 'oauth_token', 'oauth_token_secret'));
}
示例5:
function __construct()
{
// Call the parent constructor
parent::__construct('answer_category', DB_DEFAULT);
// Set the relationships
$this->HasMany('Answer');
$this->HasMany('Category');
// Set the Required
$this->SetRequired(array('answer_id', 'category_id'));
}
示例6:
function __construct()
{
// Call the parent constructor
parent::__construct('categories', DB_DEFAULT);
// Set the relationships
$this->HasMany('Answer', 'AnswerCategory');
$this->BelongsTo('User');
// Set the Required
$this->SetRequired(array('user_id', 'status', 'category'));
}
示例7: __construct
/**
* Session constructor
*/
public function __construct()
{
parent::__construct();
if (is_null(static::$config) && isset($GLOBALS['config'])) {
static::$config = $GLOBALS['config'];
}
// User information
if (php_sapi_name() != 'cli' && !isset($_SERVER['REMOTE_ADDR'])) {
throw new ErrorException('Unable to determine your IP address.');
}
$this->userip = DetectProxy();
if (empty($this->userip)) {
$this->userip = $_SERVER['REMOTE_ADDR'];
}
$this->useragent = isset($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 100) : '';
// Filter out long numbers (4+ digits)
$this->useragent = preg_replace('/([0-9]{4,12})/', '', $this->useragent);
// Filter out version except major version number
$this->useragent = preg_replace('/([0-9]{1,10})([\\._-])?([0-9]{1,10})?([\\._-])?([0-9]{1,10})?([\\._-])?([0-9]{1,10})?([\\._-])?([0-9]{1,10})?/', '$1', $this->useragent);
}
示例8:
function __construct($id = null)
{
parent::__construct($id);
}
示例9: __construct
public function __construct($group_name = '')
{
parent::__construct();
$this->initDb($group_name);
}
示例10: __construct
public function __construct($id = 0)
{
parent::__construct($id);
}
示例11: __construct
public function __construct($id = 0)
{
parent::__construct($id);
$this->pl = ilCertificatePlugin::getInstance();
}
示例12: __construct
/**
* @param int $primary_key
* @param bool $dev
*/
public function __construct($primary_key = 0, $dev = false)
{
parent::__construct($primary_key, new arConnectorSession());
}
示例13: __construct
public function __construct($id = 0)
{
global $ilLog, $ilAppEventHandler;
parent::__construct($id);
$this->log = $ilLog;
$this->pl = ilCertificatePlugin::getInstance();
$this->event_handler = $ilAppEventHandler;
}
示例14: __construct
public function __construct($scenario = 'insert', $api_name = null)
{
$this->_api_name = $api_name;
parent::__construct($scenario);
}