array('numeric'), 'display_name' => array('notempty'), 'id_federal' => array('ssn'), 'id_exp' => array('date') ); var $hasMany = array( 'ContactsMethod', 'ContactsCustomer', ); var $hasAndBelongsToMany = array( 'Customer', 'ContactAddress' => array( 'joinTable' => 'contacts_methods', 'associationForeignKey' => 'method_id', 'unique' => true, 'conditions' => "method = 'ADDRESS'", ), 'ContactPhone' => array( 'joinTable' => 'contacts_methods', 'associationForeignKey' => 'method_id', 'unique' => true, 'conditions' => "method = 'PHONE'", ), 'ContactEmail' => array( 'joinTable' => 'contacts_methods', 'associationForeignKey' => 'method_id', 'unique' => true, 'conditions' => "method = 'EMAIL'", ), ); function contactList() { return $this->find('list', array('order' => //array('last_name', 'first_name', 'middle_name'), array('display_name'), )); } } ?>