當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。