cmc-sales/models/address.php

74 lines
1.8 KiB
PHP
Executable file

<?php
class Address extends AppModel {
var $name = 'Address';
var $validate = array(
'address' => array(
'rule' => array('notEmpty'),
'message' => 'Please Enter the Addess',
'required' => true,
'allowEmpty' => false
),
'city' => array(
'rule' => array('notEmpty'),
'message' => 'Please Enter the City',
'required' => true,
'allowEmpty' => false
),
'state_id' => array(
'rule' => array('notEmpty'),
'message' => 'Please select the State',
'required' => true,
'allowEmpty' => false
),
'postcode' => array(
'rule' => array('notEmpty'),
'message' => 'Please enter the Post Code',
'required' => true,
'allowEmpty' => false
),
'country_id' => array(
'rule' => array('notEmpty'),
'message' => 'Please select the Country',
'required' => true,
'allowEmpty' => false
),
'type' => array(
'rule' => array('notEmpty'),
'message' => 'Please select the Type of Address',
'required' => true,
'allowEmpty' => false
),
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Customer' => array('className' => 'Customer',
'foreignKey' => 'customer_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'State' => array('className' => 'State',
'foreignKey' => 'state_id',
'conditions' => '',
'fields' => '',
'order' => ''),
'Country' => array('className' => 'Country',
'foreignKey' => 'country_id',
'conditions' => '',
'fields' => '',
'order' => ''
));
}
?>