| Total Complexity | 1 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Note extends Model |
||
| 9 | { |
||
| 10 | use TableCache; |
||
| 11 | // public function __construct(Array $attributes = []) |
||
| 12 | // { |
||
| 13 | // parent::__construct($attributes); |
||
| 14 | // $db = \Session::get('db'); |
||
| 15 | // error_log('+++++Note++++++++++++++++++++++++++++++'.$db); |
||
| 16 | // if(empty($db)) { |
||
| 17 | // $db = env('DB_DATABASE', 'enso'); |
||
| 18 | // } |
||
| 19 | // if($db === env('DB_DATABASE')) { |
||
| 20 | // $key = 'database.connections.mysql.database'; |
||
| 21 | // config([$key => $db]); |
||
| 22 | // } else { |
||
| 23 | // $key = 'database.connections.mysql.database'; |
||
| 24 | // config([$key => $db]); |
||
| 25 | // } |
||
| 26 | // \DB::purge('mysql'); |
||
| 27 | // \DB::reconnect('mysql'); |
||
| 28 | // $this->setConnection('mysql'); |
||
| 29 | // error_log('-----------------------------------'.$this->getConnection()->getDatabaseName()); |
||
| 30 | // } |
||
| 31 | /** |
||
| 32 | * The "type" of the auto-incrementing ID. |
||
| 33 | * |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | protected $keyType = 'integer'; |
||
| 37 | |||
| 38 | protected $fillable = ['gid', 'note', 'rin', 'name', 'description', 'is_active', 'type_id', 'group']; |
||
| 39 | |||
| 40 | protected $attributes = ['is_active' => false]; |
||
| 41 | |||
| 42 | protected $casts = ['is_active' => 'boolean']; |
||
| 43 | |||
| 44 | public function person() |
||
| 49 |