Files
pmgr/site/models/contact.php
abijah 708910870c Removed what I believe to be unnecessary fields from the contacts model, since they should be determinable by convention.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@143 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-06-16 02:24:39 +00:00

35 lines
832 B
PHP

<?php
class Contact extends AppModel {
var $name = 'Contact';
var $validate = array(
'id' => array('numeric'),
'display_name' => array('notempty'),
'id_federal' => array('ssn'),
'id_exp' => array('date')
);
var $hasAndBelongsToMany = array(
'Customer',
'ContactAddress' => array(
'joinTable' => 'contacts_methods',
'associationForeignKey' => 'method_id',
'unique' => true,
'conditions' => "method = 'POST'",
),
'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'",
),
);
}
?>