Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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