<?php

App::uses('Model', 'Model');

/**
 * Application model for Cake.
 *
 * Add your application-wide methods in the class below, your models
 * will inherit them.
 *
 * @package       app.Model
 */

class Calendar extends AppModel {

	public $hasAndBelongsToMany  = array(
			'Region' => array('className' => 'Region', 'foreignKey' => 'calendar_id', 'joinTable'=>'calendar_regions', 'fields'=>array('id','title')),
			'Depot' => array('className' => 'Depot', 'foreignKey' => 'calendar_id', 'joinTable'=>'calendar_depots', 'fields'=>array('id','title')), 
			'User' => array('className' => 'User', 'foreignKey' => 'calendar_id', 'joinTable'=>'calendar_users', 'fields'=>array('id', 'name'))
		);
}