This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
memberdb/application/classes/Model/Room/Children.php

47 lines
1.0 KiB
PHP
Raw Normal View History

2014-09-05 12:19:22 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports Children in a Room Configuration
*
* @package Membership Database
* @category Models
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Model_Room_Children extends ORM {
protected $_belongs_to = array(
'child'=>array(),
);
2014-10-22 11:22:47 +00:00
public function filters() {
return Arr::merge(parent::filters(),array(
'date_start'=>array(array('strtotime', array(':value'))),
'date_stop'=>array(array('strtotime', array(':value'))),
));
}
public function rules() {
$x = parent::rules();
unset($x['id']);
return $x;
}
protected $_display_filters = array(
'date_start'=>array(
array('Site::Date',array(':value')),
),
'date_stop'=>array(
array('Site::Date',array(':value')),
),
);
2014-09-05 12:19:22 +00:00
// @todo: Code A (availble) start/end dates cannot overlap with existing records - put in validation that it cannot be saved.
public function day($day) {
return $this->{'d_'.$day};
}
}
?>