git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@81 97e9348a-65ac-dc4b-aefc-98561f571b83
41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
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(
|
|
'className' => 'ContactAddress',
|
|
'joinTable' => 'contacts_methods',
|
|
'foreignKey' => 'contact_id',
|
|
'associationForeignKey' => 'method_id',
|
|
'unique' => true,
|
|
'conditions' => "method = 'POST'",
|
|
),
|
|
'ContactPhone' => array(
|
|
'className' => 'ContactPhone',
|
|
'joinTable' => 'contacts_methods',
|
|
'foreignKey' => 'contact_id',
|
|
'associationForeignKey' => 'method_id',
|
|
'unique' => true,
|
|
'conditions' => "method = 'PHONE'",
|
|
),
|
|
'ContactEmail' => array(
|
|
'className' => 'ContactEmail',
|
|
'joinTable' => 'contacts_methods',
|
|
'foreignKey' => 'contact_id',
|
|
'associationForeignKey' => 'method_id',
|
|
'unique' => true,
|
|
'conditions' => "method = 'EMAIL'",
|
|
),
|
|
);
|
|
|
|
}
|
|
?>
|