Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12345 anikendra 1
<?php
2
App::uses('AppModel', 'Model');
3
/**
4
 * Group Model
5
 *
6
 * @property User $User
7
 */
8
class Group extends AppModel {
9
 
10
/**
11
 * Display field
12
 *
13
 * @var string
14
 */
15
	public $displayField = 'name';
16
 
17
/**
18
 * Validation rules
19
 *
20
 * @var array
21
 */
22
	public $validate = array(
23
		'name' => array(
24
			'notempty' => array(
25
				'rule' => array('notempty'),
26
				//'message' => 'Your custom message here',
27
				//'allowEmpty' => false,
28
				//'required' => false,
29
				//'last' => false, // Stop validation after this rule
30
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
31
			),
32
		),
33
	);
34
 
35
	//The Associations below have been created with all possible keys, those that are not needed can be removed
36
 
37
/**
38
 * hasMany associations
39
 *
40
 * @var array
41
 */
42
	public $hasMany = array(
43
		'User' => array(
44
			'className' => 'User',
45
			'foreignKey' => 'group_id',
46
			'dependent' => false,
47
			'conditions' => '',
48
			'fields' => '',
49
			'order' => '',
50
			'limit' => '',
51
			'offset' => '',
52
			'exclusive' => '',
53
			'finderQuery' => '',
54
			'counterQuery' => ''
55
		)
56
	);
57
 
58
}