belongsTo('Authors'); $this->belongsToMany('Tags'); $this->hasMany('ArticlesTags'); } /** * Find published * * @param \Cake\ORM\Query $query The query * @param array $options The options * @return \Cake\ORM\Query */ public function findPublished($query, array $options = []) { $query = $query->where(['published' => 'Y']); if (isset($options['title'])) { $query->andWhere(['title' => $options['title']]); } return $query; } /** * Example public method * * @return void */ public function doSomething() { } /** * Example Secondary public method * * @return void */ public function doSomethingElse() { } /** * Example protected method * * @return void */ protected function _innerMethod() { } }