Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Restaurant extends AppModel {
- var $name = 'Restaurant';
- var $displayField = 'name';
- var $validate = array(
- 'name' => 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
- ),
- ),
- 'address' => 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
- ),
- ),
- 'area_id' => array(
- 'numeric' => array(
- 'rule' => array('numeric'),
- //'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
- ),
- ),
- );
- //The Associations below have been created with all possible keys, those that are not needed can be removed
- var $hasOne = array(
- 'RestaurantAttribute' => array(
- 'className' => 'RestaurantAttribute',
- 'foreignKey' => 'restaurant_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- )
- );
- var $belongsTo = array(
- 'Area' => array(
- 'className' => 'Area',
- 'foreignKey' => 'area_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- )
- );
- var $hasMany = array(
- 'Buffet' => array(
- 'className' => 'Buffet',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),
- 'Menu' => array(
- 'className' => 'Menu',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),
- 'RestaurantContact' => array(
- 'className' => 'RestaurantContact',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),
- 'RestaurantFeedback' => array(
- 'className' => 'RestaurantFeedback',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),
- 'RestaurantOperationHour' => array(
- 'className' => 'RestaurantOperationHour',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),
- 'RestaurantRating' => array(
- 'className' => 'RestaurantRating',
- 'foreignKey' => 'restaurant_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- )
- );
- var $hasAndBelongsToMany = array(
- 'Cuisine' => array(
- 'className' => 'Cuisine',
- 'joinTable' => 'cuisines_restaurants',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'cuisine_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- ),
- 'Event' => array(
- 'className' => 'Event',
- 'joinTable' => 'events_restaurants',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'event_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- ),
- 'Photo' => array(
- 'className' => 'Photo',
- 'joinTable' => 'photos_restaurants',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'photo_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- ),
- 'RestaurantChain' => array(
- 'className' => 'RestaurantChain',
- 'joinTable' => 'restaurant_chains_restaurants',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'restaurant_chain_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- ),
- 'Type' => array(
- 'className' => 'Type',
- 'joinTable' => 'restaurants_types',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'type_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- ),
- 'User' => array(
- 'className' => 'User',
- 'joinTable' => 'restaurants_users',
- 'foreignKey' => 'restaurant_id',
- 'associationForeignKey' => 'user_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- )
- );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement