/** * Initialize method. * * @param array $config The configuration for the Table. * @return void */ public function initialize(array $config) { parent::initialize($config); $this->table('modules'); $this->primaryKey('id'); $this->addBehavior('Search.Searchable'); $this->behaviors()->load('Union/Core.Cached', ['config' => 'positions', 'groups' => ['positions']]); }
/** * Initialize method * * @param array $config The configuration for the Table. * @return void */ public function initialize(array $config) { parent::initialize($config); $this->table('users'); $this->primaryKey('id'); $this->displayField('id'); $this->addBehavior('Timestamp'); $this->addBehavior('Search.Searchable'); $this->addBehavior('Union/Community.Avatar'); $this->addBehavior('Union/Core.Slug', ['field' => 'name']); $this->addAssociations(['belongsTo' => ['Roles' => ['foreignKey' => 'role_id', 'className' => 'Union/Community.Roles']]]); }
/** * Reload find method for search. * * @param Query $query * @param array $options * @return Query */ public function findThreaded(Query $query, array $options) { if (isset($options['parsedParams'])) { $searchable = $this->behaviors()->get('Searchable'); $query = $searchable->findSearchable($query, $options['parsedParams']); } return parent::findThreaded($query, $options); }