<?php
class Project extends AppModel {
	var $name = 'Project';
	#var $validate = array(
	#	'name' => array(
	#		'notempty' => array(
	#			'rule' => array('notempty'),
	#			//'message' => 'Your custom message here',
	#			//'allowEmpty' => false,
	#			//'required' => false,
	#			//'last' => false, // Stop validation after this rule
	#			//'on' => 'create', // Limit validation to 'create' or 'update' operations
	#		),
	#	),
	#);
	
	var $validate = array(
		'name' => array(
			'rule' => 'notEmpty',
			'message' => 'Please enter a name for the project'
		),
		'waiting_period' => array(
			'rule' => 'numeric',
			'message' => 'Please supply the waiting period in years'
		),
		'start_date' => array(
			'rule' => 'notEmpty',
			'message' => 'Please supply the start date'
		),
		'end_date' => array(
			'rule' => 'notEmpty',
			'message' => 'Please supply the end date'
		)
	);
	
	var $hasAndBelongsToMany = array(
		'Person' => array(
			'className' => 'Person',
			'joinTable' => 'projectpeople',
			'foreignKey' => 'project_id',
			'associationForeignKey' => 'person_id'
		)
	);
}
?>
