Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13579 anikendra 1
<?php
2
App::uses('AppModel', 'Model');
3
/**
4
 * CategoryDiscount Model
5
 *
6
 * @property Category $Category
7
 */
8
class CategoryDiscount extends AppModel {
9
 
10
/**
11
 * Validation rules
12
 *
13
 * @var array
14
 */
15
	public $validate = array(
16
		'category_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
		'brand' => 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
		'min_discount' => array(
37
			'decimal' => array(
38
				'rule' => array('decimal'),
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
		'max_discount' => array(
47
			'decimal' => array(
48
				'rule' => array('decimal'),
49
				//'message' => 'Your custom message here',
50
				//'allowEmpty' => false,
51
				//'required' => false,
52
				//'last' => false, // Stop validation after this rule
53
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
54
			),
55
		),
56
		'discount_category' => array(
57
			'inList' => array(
58
				'rule' => array('inList',array('mrp','dp')),
59
				//'message' => 'Your custom message here',
60
				//'allowEmpty' => false,
61
				//'required' => false,
62
				//'last' => false, // Stop validation after this rule
63
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
64
			),
65
		),
66
	);
67
 
68
	//The Associations below have been created with all possible keys, those that are not needed can be removed
69
 
70
/**
71
 * belongsTo associations
72
 *
73
 * @var array
74
 */
75
	public $belongsTo = array(
76
		'Category' => array(
77
			'className' => 'Category',
78
			'foreignKey' => 'category_id',
79
			'conditions' => '',
80
			'fields' => '',
81
			'order' => ''
82
		)
83
	);
84
}