pictcode / app / Model / ContactValidate.php @ b3a58ce1
履歴 | 表示 | アノテート | ダウンロード (1014 Bytes)
1 | 33ddd711 | admin | <?php
|
---|---|---|---|
2 | App::uses('AppModel', 'Model'); |
||
3 | /**
|
||
4 | * ContactValidate Model
|
||
5 | *
|
||
6 | */
|
||
7 | class ContactValidate extends AppModel { |
||
8 | |||
9 | public $useTable = false; |
||
10 | b3a58ce1 | hasse | public $name = 'ContactValidate'; |
11 | 33ddd711 | admin | |
12 | public $_schema = array( |
||
13 | 'name' => array( |
||
14 | 'type' => 'string', |
||
15 | 'length' => 128, |
||
16 | ), |
||
17 | 'mail' => array( |
||
18 | 'type' => 'string', |
||
19 | 'length' => 255, |
||
20 | ), |
||
21 | 'comment' => array( |
||
22 | 'type' => 'string', |
||
23 | 'length' => 255, |
||
24 | ), |
||
25 | ); |
||
26 | |||
27 | /**
|
||
28 | * Validation rules
|
||
29 | *
|
||
30 | * @var array
|
||
31 | */
|
||
32 | public $validate = array( |
||
33 | 'name' => array( |
||
34 | 'notblank' => array( |
||
35 | 'rule' => array('notBlank'), |
||
36 | 'message' => '入力されていません', |
||
37 | ), |
||
38 | ), |
||
39 | b3a58ce1 | hasse | 'email' => array( |
40 | 33ddd711 | admin | 'notblank' => array( |
41 | 'rule' => array('notBlank'), |
||
42 | 'message' => '入力されていません', |
||
43 | ), |
||
44 | 'isEmail' => array( |
||
45 | 'rule' => 'Email', |
||
46 | 'message' => '入力形式が正しくありません', |
||
47 | ), |
||
48 | ), |
||
49 | 'comment' => array( |
||
50 | 'notblank' => array( |
||
51 | 'rule' => array('notblank'), |
||
52 | 'message' => '入力されていません', |
||
53 | ), |
||
54 | ), |
||
55 | ); |
||
56 | } |