@@ 17-35 (lines=19) @@ | ||
14 | * |
|
15 | * @return void |
|
16 | */ |
|
17 | public function initialize(array $config) |
|
18 | { |
|
19 | $this->table('groups'); |
|
20 | $this->displayField('name'); |
|
21 | $this->primaryKey('id'); |
|
22 | ||
23 | $this->addBehavior('Timestamp'); |
|
24 | $this->addBehavior('Acl.Acl', [ |
|
25 | 'type' => 'requester' |
|
26 | ]); |
|
27 | $this->addBehavior('Translate', [ |
|
28 | 'fields' => ['name'], |
|
29 | 'translationTable' => 'GroupsI18n' |
|
30 | ]); |
|
31 | ||
32 | $this->hasMany('Users', [ |
|
33 | 'foreignKey' => 'group_id' |
|
34 | ]); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * Default validation rules. |
@@ 17-33 (lines=17) @@ | ||
14 | * |
|
15 | * @return void |
|
16 | */ |
|
17 | public function initialize(array $config) |
|
18 | { |
|
19 | $this->table('blog_categories'); |
|
20 | $this->displayField('title'); |
|
21 | $this->primaryKey('id'); |
|
22 | ||
23 | $this->addBehavior('Timestamp'); |
|
24 | $this->addBehavior('Translate', [ |
|
25 | 'fields' => ['title', 'description'], |
|
26 | 'translationTable' => 'BlogCategoriesI18n' |
|
27 | ]); |
|
28 | ||
29 | $this->hasMany('BlogArticles', [ |
|
30 | 'foreignKey' => 'category_id', |
|
31 | 'dependent' => true |
|
32 | ]); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Default validation rules. |