本文整理汇总了PHP中AppModel::construct_if_not_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::construct_if_not_exists方法的具体用法?PHP AppModel::construct_if_not_exists怎么用?PHP AppModel::construct_if_not_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::construct_if_not_exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($title, $user_id, $date_created = NULL)
{
parent::__construct($date_created);
$this->fields["title"] = array($title, "VARCHAR(512)");
$this->fields["user_id"] = array($user_id, "INT(11), FOREIGN KEY(user_id) REFERENCES user_models(id) ON DELETE CASCADE");
parent::construct_if_not_exists();
}
示例2: __construct
public function __construct($page_id, $q_and_a, $date_created = NULL)
{
parent::__construct($date_created);
$this->fields["page_id"] = array($page_id, "INT(11), FOREIGN KEY(page_id) REFERENCES page_models(id) ON DELETE CASCADE");
$this->fields["q_and_a"] = array($q_and_a, "TEXT");
parent::construct_if_not_exists();
}
示例3: __construct
public function __construct($page_text, $adventure_id, $img_url, $date_created = NULL)
{
parent::__construct($date_created);
$this->fields["page_text"] = array($page_text, "TEXT");
$this->fields["adventure_id"] = array($adventure_id, "INT(11), FOREIGN KEY(adventure_id) REFERENCES adventure_models(id) ON DELETE CASCADE");
$this->fields["image_url"] = array($img_url, "VARCHAR(512)");
parent::construct_if_not_exists();
}
示例4: __construct
public function __construct($first_name, $last_name, $email, $password, $last_login, $failed_login_attempts = 0, $date_created = NULL)
{
parent::__construct($date_created);
$this->fields["first_name"] = array($first_name, "VARCHAR(255)");
$this->fields["last_name"] = array($last_name, "VARCHAR(255)");
$this->fields["email"] = array($email, "VARCHAR(255)");
$this->fields["password"] = array(MD5($password), "VARCHAR(512)");
$this->fields["last_login"] = array($last_login, "TIMESTAMP");
$this->fields["failed_login_attempts"] = array($failed_login_attempts, "INT(11)");
parent::construct_if_not_exists();
}