本文整理匯總了PHP中app\models\BaseModel::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseModel::__construct方法的具體用法?PHP BaseModel::__construct怎麽用?PHP BaseModel::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\BaseModel
的用法示例。
在下文中一共展示了BaseModel::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name);
$this->createRule = ['name' => 'string', 'name_in_charge' => 'string', 'city_id' => 'required|numeric', 'province_id' => 'required|numeric', 'location_detail' => 'string', 'username' => 'required|unique:' . table_name($this->ins_name), 'password' => 'required|min:6', 'phone' => 'numeric|min:11', 'email' => 'email', 'status' => 'numeric', 'memo' => 'string'];
$this->updateRule = ['id' => 'required|numeric', 'password' => 'min:6'];
}
示例2: __construct
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
if (app()->environment() === 'production') {
$this->setConnection('mysql-hr');
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name);
$this->createRule = ['name' => 'required', 'username' => 'required|unique:' . table_name($this->ins_name), 'password' => 'required|min:6', 'hospital_id' => 'required|exists:' . table_name('hospital') . ',id'];
$this->updateRule = ['id' => 'required|numeric'];
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->createRule = ['cust_id' => 'required|unique:i_robot|regex:/^[0-9]{2}[A-L]{1}[0-9]{4}$/', 'employee_id' => 'required|exists:i_employee,id', 'production_date' => 'required|date'];
//$this->messages['regex'] = '字段 :attribute 格式錯誤';
$this->messages['regex'] = '該值格式錯誤';
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->createRule = ['city_id' => 'required|numeric', 'province_id' => 'required|numeric', 'localtion_detail' => 'string', 'name' => 'required|unique:i_hospital,name', 'memo' => 'string'];
$this->updateRule = [];
$this->messages['name.unique'] = '醫院名字已存在';
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name);
$this->createRule = ['name' => 'required', 'username' => 'required|unique:' . table_name($this->ins_name), 'password' => 'required|alpha_num|min:6', 'phone' => 'required', 'email' => 'required|email', 'status' => 'numeric', 'memo' => 'string'];
$this->updateRule = ['id' => 'required|numeric', 'username' => 'unique:' . table_name($this->ins_name) . ',username,' . rq('id'), 'password' => 'alpha_num|min:6'];
$this->messages = ['username.required' => '用戶名必填', 'username.unique' => '用戶名已被使用', 'password.required' => '密碼必填', 'password.min' => '密碼至少有6位字母或者數字', 'phone.required' => '手機號碼必填', 'email.required' => '電子郵箱必填', 'email.email' => '郵箱格式有誤'];
}
示例7:
function __construct($init = [])
{
if (is_array($init)) {
return parent::__construct($init);
} else {
$this->name = $init;
}
}
示例8: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name, 'i');
$this->createRule = ['email' => 'required|email', 'name' => 'required', 'phone' => 'required'];
$this->updateRule = ['email' => 'required|email', 'name' => 'required', 'phone' => 'required'];
$this->messages = ['phone.required' => '手機號碼必填', 'email.required' => '電子郵箱必填', 'email.email' => '郵箱格式有誤'];
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name);
$this->createRule = ['name' => 'required', 'username' => 'required|unique:' . table_name($this->ins_name), 'password' => 'required|min:6|regex:/^(?=.*[a-zA-Z])(?=.*[\\d])[a-zA-Z\\d].+$/', 'hospital_id' => 'required|exists:' . table_name('hospital') . ',id'];
$this->updateRule = ['id' => 'required|numeric', 'password' => 'min:6|regex:/^(?=.*[a-zA-Z])(?=.*[\\d])[a-zA-Z\\d].+$/'];
$this->messages = ['password.regex' => '密碼不符合要求,必選包含字母和數字', 'password.min' => '密碼必須大於6位'];
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name);
$this->createRule = ['name' => 'required', 'username' => 'required|unique:' . table_name($this->ins_name), 'password' => 'required|min:6|regex:/^(?=.*[a-zA-Z])(?=.*[\\d])[a-zA-Z\\d].+$/', 'phone' => 'required', 'email' => 'required|email', 'status' => 'numeric', 'memo' => 'string'];
$this->updateRule = ['id' => 'required|numeric', 'username' => 'unique:' . table_name($this->ins_name) . ',username,' . rq('id'), 'password' => 'min:6|regex:/^(?=.*[a-zA-Z])(?=.*[\\d])[a-zA-Z\\d].+$/'];
$this->messages = ['username.required' => '用戶名必填', 'username.unique' => '用戶名已被使用', 'password.required' => '密碼必填', 'password.regex' => '密碼不符合要求,必選包含字母和數字', 'password.min' => '密碼必須大於6位', 'phone.required' => '手機號碼必填', 'email.required' => '電子郵箱必填', 'email.email' => '郵箱格式有誤'];
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->table = table_name($this->ins_name, 'i');
// $this->createRule = [
// 'email' => 'required|email',
// 'name' => 'required'
// ];
}
示例12:
function __construct($init = [])
{
$this->_tables = [];
if (is_array($init)) {
parent::__construct($init);
} else {
$this->name = $init;
}
if (!$this->name) {
$this->name = data_db_name();
}
static::$list[$this->name] = $this;
}
示例13: ref
function __construct($init = [], $db_name = NULL, $db = NULL)
{
if (is_array($init)) {
return parent::__construct($init);
} else {
$this->name = $init;
}
if ($db_name) {
$this->db_name = $db_name;
}
if ($db) {
$this->db = ref($db);
}
if ($this->db_name && !$this->db) {
$this->db = ref(Database::by_name($db_name));
}
$this->__owner = ref($this->db);
}
示例14: __construct
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->createRule = ['city_id' => 'required|numeric', 'province_id' => 'required|numeric', 'localtion_detail' => 'string', 'name' => 'required', 'memo' => 'string'];
$this->updateRule = [];
}