Subversion Repositories SmartDukaan

Rev

Rev 13532 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13532 anikendra 1
<?php
2
App::uses('AppModel', 'Model');
3
/**
4
 * StoreProduct Model
5
 *
6
 * @property Store $Store
7
 * @property Product $Product
8
 * @property Click $Click
9
 * @property UserAction $UserAction
10
 */
11
class StoreProduct extends AppModel {
12
 
13
/**
14
 * Validation rules
15
 *
16
 * @var array
17
 */
18
	public $validate = array(
19
		'store_id' => array(
20
			'numeric' => array(
21
				'rule' => array('numeric'),
22
				//'message' => 'Your custom message here',
23
				//'allowEmpty' => false,
24
				//'required' => false,
25
				//'last' => false, // Stop validation after this rule
26
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
27
			),
28
		),
29
		'product_id' => array(
30
			'numeric' => array(
31
				'rule' => array('numeric'),
32
				//'message' => 'Your custom message here',
33
				//'allowEmpty' => false,
34
				//'required' => false,
35
				//'last' => false, // Stop validation after this rule
36
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
37
			),
38
		),
39
		'product_url' => array(
40
			'notEmpty' => array(
41
				'rule' => array('notEmpty'),
42
				//'message' => 'Your custom message here',
43
				//'allowEmpty' => false,
44
				//'required' => false,
45
				//'last' => false, // Stop validation after this rule
46
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
47
			),
48
		),
49
		'img_url' => array(
50
			'notEmpty' => array(
51
				'rule' => array('notEmpty'),
52
				//'message' => 'Your custom message here',
53
				//'allowEmpty' => false,
54
				//'required' => false,
55
				//'last' => false, // Stop validation after this rule
56
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
57
			),
58
		),
59
		'short_descrption' => array(
60
			'notEmpty' => array(
61
				'rule' => array('notEmpty'),
62
				//'message' => 'Your custom message here',
63
				//'allowEmpty' => false,
64
				'required' => false,
65
				//'last' => false, // Stop validation after this rule
66
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
67
			),
68
		),
69
		'price' => array(
70
			'numeric' => array(
71
				'rule' => array('numeric'),
72
				//'message' => 'Your custom message here',
73
				//'allowEmpty' => false,
74
				//'required' => false,
75
				//'last' => false, // Stop validation after this rule
76
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
77
			),
78
		),
79
	);
80
 
81
	//The Associations below have been created with all possible keys, those that are not needed can be removed
82
 
83
/**
84
 * belongsTo associations
85
 *
86
 * @var array
87
 */
88
	public $belongsTo = array(
89
		'Store' => array(
90
			'className' => 'Store',
91
			'foreignKey' => 'store_id',
92
			'conditions' => '',
93
			'fields' => '',
94
			'order' => ''
95
		),
96
		'Product' => array(
97
			'className' => 'Product',
98
			'foreignKey' => 'product_id',
99
			'conditions' => '',
100
			'fields' => '',
101
			'order' => ''
102
		)
103
	);
104
 
105
/**
106
 * hasMany associations
107
 *
108
 * @var array
109
 */
110
	public $hasMany = array(
111
		'Click' => array(
112
			'className' => 'Click',
113
			'foreignKey' => 'store_product_id',
114
			'dependent' => false,
115
			'conditions' => '',
116
			'fields' => '',
117
			'order' => '',
118
			'limit' => '',
119
			'offset' => '',
120
			'exclusive' => '',
121
			'finderQuery' => '',
122
			'counterQuery' => ''
123
		),
124
		'UserAction' => array(
125
			'className' => 'UserAction',
126
			'foreignKey' => 'store_product_id',
127
			'dependent' => false,
128
			'conditions' => '',
129
			'fields' => '',
130
			'order' => '',
131
			'limit' => '',
132
			'offset' => '',
133
			'exclusive' => '',
134
			'finderQuery' => '',
135
			'counterQuery' => ''
136
		)
137
	);
138
}