Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function initialize(array $config)
- {
- parent::initialize($config);
- $this->setTable('followers');
- $this->setDisplayField('id');
- $this->setPrimaryKey('id');
- $this->addBehavior('Timestamp');
- $this->belongsTo('Followers', [
- 'className' => 'Users',
- 'joinTable' => 'Users',
- 'foreignKey' => 'follower_id',
- 'joinType' => 'INNER'
- ]);
- $this->belongsTo('Users', [
- 'foreignKey' => 'user_id',
- 'joinType' => 'INNER'
- ]);
- $this->hasMany('Followers', [
- 'foreignKey' => 'follower_id'
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement