| @@ 17-31 (lines=15) @@ | ||
| 14 | * |
|
| 15 | * @return void |
|
| 16 | */ |
|
| 17 | public function initialize(array $config) |
|
| 18 | { |
|
| 19 | $this->table('badges_users'); |
|
| 20 | $this->displayField('id'); |
|
| 21 | $this->primaryKey('id'); |
|
| 22 | ||
| 23 | $this->addBehavior('Timestamp'); |
|
| 24 | ||
| 25 | $this->belongsTo('Badges', [ |
|
| 26 | 'foreignKey' => 'badge_id', |
|
| 27 | ]); |
|
| 28 | $this->belongsTo('Users', [ |
|
| 29 | 'foreignKey' => 'user_id', |
|
| 30 | ]); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Default validation rules. |
|
| @@ 16-30 (lines=15) @@ | ||
| 13 | * @param array $config The configuration for the Table. |
|
| 14 | * @return void |
|
| 15 | */ |
|
| 16 | public function initialize(array $config) |
|
| 17 | { |
|
| 18 | $this->table('conversations_users'); |
|
| 19 | $this->displayField('id'); |
|
| 20 | $this->primaryKey('id'); |
|
| 21 | ||
| 22 | $this->addBehavior('Timestamp'); |
|
| 23 | ||
| 24 | $this->belongsTo('Conversations', [ |
|
| 25 | 'foreignKey' => 'conversation_id' |
|
| 26 | ]); |
|
| 27 | $this->belongsTo('Users', [ |
|
| 28 | 'foreignKey' => 'user_id' |
|
| 29 | ]); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||
| @@ 19-33 (lines=15) @@ | ||
| 16 | * |
|
| 17 | * @return void |
|
| 18 | */ |
|
| 19 | public function initialize(array $config) |
|
| 20 | { |
|
| 21 | parent::initialize($config); |
|
| 22 | ||
| 23 | $this->table('settings'); |
|
| 24 | $this->displayField('name'); |
|
| 25 | $this->primaryKey('id'); |
|
| 26 | ||
| 27 | $this->addBehavior('Timestamp'); |
|
| 28 | ||
| 29 | $this->belongsTo('LastUpdatedUser', [ |
|
| 30 | 'className' => 'Users', |
|
| 31 | 'foreignKey' => 'last_updated_user_id' |
|
| 32 | ]); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Set the settings from the database. |
|
| @@ 17-28 (lines=12) @@ | ||
| 14 | * @param array $config The configuration for the Table. |
|
| 15 | * @return void |
|
| 16 | */ |
|
| 17 | public function initialize(array $config) |
|
| 18 | { |
|
| 19 | $this->table('sessions'); |
|
| 20 | $this->displayField('id'); |
|
| 21 | $this->primaryKey('id'); |
|
| 22 | ||
| 23 | $this->addBehavior('Timestamp'); |
|
| 24 | ||
| 25 | $this->belongsTo('Users', [ |
|
| 26 | 'foreignKey' => 'user_id' |
|
| 27 | ]); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Custom finder for select sessions no-expired. |
|
| @@ 14-27 (lines=14) @@ | ||
| 11 | * @param array $config The configuration for the Table. |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function initialize(array $config) |
|
| 15 | { |
|
| 16 | parent::initialize($config); |
|
| 17 | ||
| 18 | $this->table('users_logs'); |
|
| 19 | $this->displayField('name'); |
|
| 20 | $this->primaryKey('id'); |
|
| 21 | ||
| 22 | $this->addBehavior('Timestamp'); |
|
| 23 | ||
| 24 | $this->belongsTo('Users', [ |
|
| 25 | 'foreignKey' => 'user_id' |
|
| 26 | ]); |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| @@ 33-46 (lines=14) @@ | ||
| 30 | * |
|
| 31 | * @return void |
|
| 32 | */ |
|
| 33 | public function initialize(array $config) |
|
| 34 | { |
|
| 35 | parent::initialize($config); |
|
| 36 | ||
| 37 | $this->table('users_two_factor_auth'); |
|
| 38 | $this->displayField('id'); |
|
| 39 | $this->primaryKey('id'); |
|
| 40 | ||
| 41 | $this->addBehavior('Timestamp'); |
|
| 42 | ||
| 43 | $this->belongsTo('Users', [ |
|
| 44 | 'foreignKey' => 'user_id' |
|
| 45 | ]); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 24-37 (lines=14) @@ | ||
| 21 | * |
|
| 22 | * @return void |
|
| 23 | */ |
|
| 24 | public function initialize(array $config) |
|
| 25 | { |
|
| 26 | parent::initialize($config); |
|
| 27 | ||
| 28 | $this->table('polls_answers'); |
|
| 29 | $this->displayField('id'); |
|
| 30 | $this->primaryKey('id'); |
|
| 31 | ||
| 32 | $this->addBehavior('Timestamp'); |
|
| 33 | ||
| 34 | $this->belongsTo('Polls', [ |
|
| 35 | 'foreignKey' => 'poll_id' |
|
| 36 | ]); |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * Default validation rules. |
|