本文整理汇总了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 = [];
}