<?php

class Site extends AppModel {

	var $useTable = 'site';
	var $id = 'id';
	var $primaryKey = 'id';
	
	var $belongsTo = array(
		'User'=> array(
			'className' => 'User',
			'foreignKey' => 'created_by'
		)
	);
	
	var $hasMany = array(
		'CriteriumValue'=>array(
			'className' => 'CriteriumValue',
			'foreignKey' => 'site',
		),
		
		'Comment'=>array(
			'className' => 'Comment',
			'foreignKey' => 'site',
		)
	);
	
	 var $hasAndBelongsToMany = array(
        'Category' =>
            array(
                'className'              => 'Category',
                'joinTable'              => 'category_site',
                'foreignKey'             => 'site',
                'associationForeignKey'  => 'category',
                'unique'                 => true,
            )
    );
			
	
}

?>