コード例 #1
0
ファイル: ModulesTable.php プロジェクト: Cheren/union
 /**
  * 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']]);
 }
コード例 #2
0
ファイル: UsersTable.php プロジェクト: Cheren/union
 /**
  * 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']]]);
 }
コード例 #3
0
ファイル: LinksTable.php プロジェクト: Cheren/union
 /**
  * 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);
 }