Subversion Repositories SmartDukaan

Rev

Rev 22429 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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