当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseModel::__construct方法代码示例

本文整理汇总了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'];
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:7,代码来源:IAgency.php

示例2: __construct

 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if (app()->environment() === 'production') {
         $this->setConnection('mysql-hr');
     }
 }
开发者ID:jrsalunga,项目名称:gi-cashier,代码行数:7,代码来源:Branch.php

示例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'];
 }
开发者ID:hellopsm,项目名称:robot,代码行数:7,代码来源:IDepartment.php

示例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'] = '该值格式错误';
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:7,代码来源:IRobot.php

示例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'] = '医院名字已存在';
 }
开发者ID:newset,项目名称:robot,代码行数:7,代码来源:IHospital.php

示例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' => '邮箱格式有误'];
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:8,代码来源:IEmployee.php

示例7:

 function __construct($init = [])
 {
     if (is_array($init)) {
         return parent::__construct($init);
     } else {
         $this->name = $init;
     }
 }
开发者ID:prkeshri,项目名称:getpanel,代码行数:8,代码来源:Column.php

示例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' => '邮箱格式有误'];
 }
开发者ID:newset,项目名称:robot,代码行数:8,代码来源:IDoctor.php

示例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位'];
 }
开发者ID:newset,项目名称:robot,代码行数:8,代码来源:IDepartment.php

示例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' => '邮箱格式有误'];
 }
开发者ID:newset,项目名称:robot,代码行数:8,代码来源:IEmployee.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->table = table_name($this->ins_name, 'i');
     // $this->createRule = [
     //     'email' => 'required|email',
     //     'name' => 'required'
     // ];
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:9,代码来源:IDoctor.php

示例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;
 }
开发者ID:prkeshri,项目名称:getpanel,代码行数:13,代码来源:Database.php

示例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);
 }
开发者ID:prkeshri,项目名称:getpanel,代码行数:18,代码来源:Table.php

示例14: __construct

 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
 }
开发者ID:jrsalunga,项目名称:gi-boss,代码行数:4,代码来源:BossBranch.php

示例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 = [];
 }
开发者ID:hellopsm,项目名称:robot,代码行数:6,代码来源:IHospital.php


注:本文中的app\models\BaseModel::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。