Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13532 anikendra 1
<?php
2
App::uses('AppModel', 'Model');
3
/**
4
 * Preference Model
5
 *
6
 * @property User $User
7
 */
8
class Preference extends AppModel {
9
 
10
/**
11
 * Validation rules
12
 *
13
 * @var array
14
 */
15
	public $validate = array(
16
		'user_id' => array(
17
			'numeric' => array(
18
				'rule' => array('numeric'),
19
				//'message' => 'Your custom message here',
20
				//'allowEmpty' => false,
21
				//'required' => false,
22
				//'last' => false, // Stop validation after this rule
23
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
24
			),
25
		),
26
		'key' => array(
27
			'notEmpty' => array(
28
				'rule' => array('notEmpty'),
29
				//'message' => 'Your custom message here',
30
				//'allowEmpty' => false,
31
				//'required' => false,
32
				//'last' => false, // Stop validation after this rule
33
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
34
			),
35
		),
36
		'value' => array(
37
			'notEmpty' => array(
38
				'rule' => array('notEmpty'),
39
				//'message' => 'Your custom message here',
40
				//'allowEmpty' => false,
41
				//'required' => false,
42
				//'last' => false, // Stop validation after this rule
43
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
44
			),
45
		),
46
	);
47
 
48
	//The Associations below have been created with all possible keys, those that are not needed can be removed
49
 
50
/**
51
 * belongsTo associations
52
 *
53
 * @var array
54
 */
55
	public $belongsTo = array(
56
		'User' => array(
57
			'className' => 'User',
58
			'foreignKey' => 'user_id',
59
			'conditions' => '',
60
			'fields' => '',
61
			'order' => ''
62
		)
63
	);
64
}