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
 * Productview Model
5
 *
6
 * @property Product $Product
7
 * @property User $User
8
 */
9
class Productview extends AppModel {
10
 
11
/**
12
 * Validation rules
13
 *
14
 * @var array
15
 */
16
	public $validate = array(
17
		'product_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
		'user_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
	);
38
 
39
	//The Associations below have been created with all possible keys, those that are not needed can be removed
40
 
41
/**
42
 * belongsTo associations
43
 *
44
 * @var array
45
 */
46
	public $belongsTo = array(
47
		'Product' => array(
48
			'className' => 'Product',
49
			'foreignKey' => 'product_id',
50
			'conditions' => '',
51
			'fields' => '',
52
			'order' => ''
53
		),
54
		'User' => array(
55
			'className' => 'User',
56
			'foreignKey' => 'user_id',
57
			'conditions' => '',
58
			'fields' => '',
59
			'order' => ''
60
		)
61
	);
62
}