<?php
class Attribute extends AppModel {
	var $name = 'Attribute';
	
	var $displayField = 'attribute_value';
	
	/*
	MultipleDisplayFields found at http://bakery.cakephp.org/articles/resshin/2008/11/15/multiple-display-field-3
	*/
	var $actsAs = array('MultipleDisplayFields' => array(
        'fields' => array('attribute', 'value'),
        'pattern' => '%s %s'
    )); 
	
	var $hasMany = array(
		'Testobjectresult' => array(
			'className' => 'Testobjectresult',
			'foreignKey' => 'attribute_id' 
		)
	);
	
	var $hasAndBelongsToMany = array(
		'Testobjectparameter' => array(
			'className' => 'Testobjectparameter',
			'associationForeignKey' => 'testobjectparameter_id',
			'foreign_key' => 'attribute_id',
			'joinTable' => 'Testobjectresults',
			'with' => 'Testobjectresult'
		)
	);
	
	
	/*var $validate = array(
		'attribute' => 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
			),
		),
		'value' => 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
			),
		),
	);*/

}
?>
