|
1
|
|
|
<?php |
|
2
|
|
|
namespace App\Model\Table; |
|
3
|
|
|
|
|
4
|
|
|
use Cake\ORM\Query; |
|
5
|
|
|
use Cake\ORM\RulesChecker; |
|
6
|
|
|
use Cake\ORM\Table; |
|
7
|
|
|
use Cake\Validation\Validator; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Siteoptions Model |
|
11
|
|
|
* |
|
12
|
|
|
* @method \App\Model\Entity\Siteoption get($primaryKey, $options = []) |
|
13
|
|
|
* @method \App\Model\Entity\Siteoption newEntity($data = null, array $options = []) |
|
14
|
|
|
* @method \App\Model\Entity\Siteoption[] newEntities(array $data, array $options = []) |
|
15
|
|
|
* @method \App\Model\Entity\Siteoption|bool save(\Cake\Datasource\EntityInterface $entity, $options = []) |
|
16
|
|
|
* @method \App\Model\Entity\Siteoption patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) |
|
17
|
|
|
* @method \App\Model\Entity\Siteoption[] patchEntities($entities, array $data, array $options = []) |
|
18
|
|
|
* @method \App\Model\Entity\Siteoption findOrCreate($search, callable $callback = null, $options = []) |
|
19
|
|
|
* |
|
20
|
|
|
* @mixin \Cake\ORM\Behavior\TimestampBehavior |
|
21
|
|
|
*/ |
|
22
|
|
|
class SiteoptionsTable extends Table |
|
23
|
|
|
{ |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Initialize method |
|
27
|
|
|
* |
|
28
|
|
|
* @param array $config The configuration for the Table. |
|
29
|
|
|
* @return void |
|
30
|
|
|
*/ |
|
31
|
|
|
public function initialize(array $config) |
|
32
|
|
|
{ |
|
33
|
|
|
parent::initialize($config); |
|
34
|
|
|
|
|
35
|
|
|
$this->table('siteoptions'); |
|
|
|
|
|
|
36
|
|
|
$this->displayField('name'); |
|
|
|
|
|
|
37
|
|
|
$this->primaryKey('id'); |
|
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
$this->addBehavior('Timestamp'); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Default validation rules. |
|
44
|
|
|
* |
|
45
|
|
|
* @param \Cake\Validation\Validator $validator Validator instance. |
|
46
|
|
|
* @return \Cake\Validation\Validator |
|
47
|
|
|
*/ |
|
48
|
|
|
public function validationDefault(Validator $validator) |
|
49
|
|
|
{ |
|
50
|
|
|
$validator |
|
|
|
|
|
|
51
|
|
|
->integer('id') |
|
52
|
|
|
->allowEmpty('id', 'create'); |
|
53
|
|
|
|
|
54
|
|
|
$validator |
|
|
|
|
|
|
55
|
|
|
->requirePresence('name', 'create') |
|
56
|
|
|
->notEmpty('name'); |
|
57
|
|
|
|
|
58
|
|
|
$validator |
|
|
|
|
|
|
59
|
|
|
->requirePresence('value', 'create') |
|
60
|
|
|
->notEmpty('value'); |
|
61
|
|
|
|
|
62
|
|
|
return $validator; |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.