<?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 Compaign extends AppModel {
			
    public $hasAndBelongsToMany  = array(
			'Depot' => array('className' => 'Depot', 'foreignKey' => 'compaign_id', 'joinTable'=>'compaigns_depots', 'fields'=>array('id','title')), 
			'Region' => array('className' => 'Region', 'foreignKey' => 'compaign_id', 'fields'=>array('id', 'title'))
		);
			
	public $belongsTo  = array(
			'Brand' => array('className' => 'Brand', 'foreignKey' => 'brand_id', 'fields' => array('id', 'name'), 'type'=>'inner'),
	);

}


