-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathReservationImport.php
More file actions
45 lines (41 loc) · 1.12 KB
/
ReservationImport.php
File metadata and controls
45 lines (41 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* ReservationImport.php
*
* @author Ryuji AMANO <ryuji@ryus.co.jp>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
/**
* Class ReservationImport
*/
class ReservationImport extends AppModel {
/**
* @var bool useTable
*/
public $useTable = false;
/**
* @var string Alias
*/
public $alias = 'ReservationActionPlan';
/**
* Called during validation operations, before validation. Please note that custom
* validation rules can be defined in $validate.
*
* @param array $options Options passed from Model::save().
* @return bool True if validate operation should continue, false to abort
* @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
* @see Model::save()
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function beforeValidate($options = array()) {
$this->validate = Hash::merge($this->validate, array(
'csv_file' => array(
'rule1' => array(
'rule' => array('extension', ['csv']),
'message' => __d('reservations', 'Please select csv file.'),
),
),
));
}
}