These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace App\Model\Table; |
||
3 | |||
4 | use Cake\ORM\Table; |
||
5 | use Cake\Validation\Validator; |
||
6 | |||
7 | class ConversationsUsersTable extends Table |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Initialize method |
||
12 | * |
||
13 | * @param array $config The configuration for the Table. |
||
14 | * @return void |
||
15 | */ |
||
16 | View Code Duplication | public function initialize(array $config) |
|
0 ignored issues
–
show
|
|||
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 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.