Advertisement
Guest User

Untitled

a guest
Jul 11th, 2010
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.75 KB | None | 0 0
  1. <?php
  2. class Restaurant extends AppModel {
  3.     var $name = 'Restaurant';
  4.     var $displayField = 'name';
  5.    
  6.     var $validate = array(
  7.         'name' => array(
  8.             'notempty' => array(
  9.                 'rule' => array('notempty'),
  10.                 //'message' => 'Your custom message here',
  11.                 //'allowEmpty' => false,
  12.                 //'required' => false,
  13.                 //'last' => false, // Stop validation after this rule
  14.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  15.             ),
  16.         ),
  17.         'address' => array(
  18.             'notempty' => array(
  19.                 'rule' => array('notempty'),
  20.                 //'message' => 'Your custom message here',
  21.                 //'allowEmpty' => false,
  22.                 //'required' => false,
  23.                 //'last' => false, // Stop validation after this rule
  24.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  25.             ),
  26.         ),
  27.         'area_id' => array(
  28.             'numeric' => array(
  29.                 'rule' => array('numeric'),
  30.                 //'message' => 'Your custom message here',
  31.                 //'allowEmpty' => false,
  32.                 //'required' => false,
  33.                 //'last' => false, // Stop validation after this rule
  34.                 //'on' => 'create', // Limit validation to 'create' or 'update' operations
  35.             ),
  36.         ),
  37.     );
  38.     //The Associations below have been created with all possible keys, those that are not needed can be removed
  39.  
  40.     var $hasOne = array(
  41.         'RestaurantAttribute' => array(
  42.             'className' => 'RestaurantAttribute',
  43.             'foreignKey' => 'restaurant_id',
  44.             'conditions' => '',
  45.             'fields' => '',
  46.             'order' => ''
  47.         )
  48.     );
  49.  
  50.     var $belongsTo = array(
  51.         'Area' => array(
  52.             'className' => 'Area',
  53.             'foreignKey' => 'area_id',
  54.             'conditions' => '',
  55.             'fields' => '',
  56.             'order' => ''
  57.         )
  58.     );
  59.  
  60.     var $hasMany = array(
  61.         'Buffet' => array(
  62.             'className' => 'Buffet',
  63.             'foreignKey' => 'restaurant_id',
  64.             'dependent' => false,
  65.             'conditions' => '',
  66.             'fields' => '',
  67.             'order' => '',
  68.             'limit' => '',
  69.             'offset' => '',
  70.             'exclusive' => '',
  71.             'finderQuery' => '',
  72.             'counterQuery' => ''
  73.         ),
  74.         'Menu' => array(
  75.             'className' => 'Menu',
  76.             'foreignKey' => 'restaurant_id',
  77.             'dependent' => false,
  78.             'conditions' => '',
  79.             'fields' => '',
  80.             'order' => '',
  81.             'limit' => '',
  82.             'offset' => '',
  83.             'exclusive' => '',
  84.             'finderQuery' => '',
  85.             'counterQuery' => ''
  86.         ),
  87.         'RestaurantContact' => array(
  88.             'className' => 'RestaurantContact',
  89.             'foreignKey' => 'restaurant_id',
  90.             'dependent' => false,
  91.             'conditions' => '',
  92.             'fields' => '',
  93.             'order' => '',
  94.             'limit' => '',
  95.             'offset' => '',
  96.             'exclusive' => '',
  97.             'finderQuery' => '',
  98.             'counterQuery' => ''
  99.         ),
  100.         'RestaurantFeedback' => array(
  101.             'className' => 'RestaurantFeedback',
  102.             'foreignKey' => 'restaurant_id',
  103.             'dependent' => false,
  104.             'conditions' => '',
  105.             'fields' => '',
  106.             'order' => '',
  107.             'limit' => '',
  108.             'offset' => '',
  109.             'exclusive' => '',
  110.             'finderQuery' => '',
  111.             'counterQuery' => ''
  112.         ),
  113.         'RestaurantOperationHour' => array(
  114.             'className' => 'RestaurantOperationHour',
  115.             'foreignKey' => 'restaurant_id',
  116.             'dependent' => false,
  117.             'conditions' => '',
  118.             'fields' => '',
  119.             'order' => '',
  120.             'limit' => '',
  121.             'offset' => '',
  122.             'exclusive' => '',
  123.             'finderQuery' => '',
  124.             'counterQuery' => ''
  125.         ),
  126.         'RestaurantRating' => array(
  127.             'className' => 'RestaurantRating',
  128.             'foreignKey' => 'restaurant_id',
  129.             'dependent' => false,
  130.             'conditions' => '',
  131.             'fields' => '',
  132.             'order' => '',
  133.             'limit' => '',
  134.             'offset' => '',
  135.             'exclusive' => '',
  136.             'finderQuery' => '',
  137.             'counterQuery' => ''
  138.         )
  139.     );
  140.  
  141.  
  142.     var $hasAndBelongsToMany = array(
  143.         'Cuisine' => array(
  144.             'className' => 'Cuisine',
  145.             'joinTable' => 'cuisines_restaurants',
  146.             'foreignKey' => 'restaurant_id',
  147.             'associationForeignKey' => 'cuisine_id',
  148.             'unique' => true,
  149.             'conditions' => '',
  150.             'fields' => '',
  151.             'order' => '',
  152.             'limit' => '',
  153.             'offset' => '',
  154.             'finderQuery' => '',
  155.             'deleteQuery' => '',
  156.             'insertQuery' => ''
  157.         ),
  158.         'Event' => array(
  159.             'className' => 'Event',
  160.             'joinTable' => 'events_restaurants',
  161.             'foreignKey' => 'restaurant_id',
  162.             'associationForeignKey' => 'event_id',
  163.             'unique' => true,
  164.             'conditions' => '',
  165.             'fields' => '',
  166.             'order' => '',
  167.             'limit' => '',
  168.             'offset' => '',
  169.             'finderQuery' => '',
  170.             'deleteQuery' => '',
  171.             'insertQuery' => ''
  172.         ),
  173.         'Photo' => array(
  174.             'className' => 'Photo',
  175.             'joinTable' => 'photos_restaurants',
  176.             'foreignKey' => 'restaurant_id',
  177.             'associationForeignKey' => 'photo_id',
  178.             'unique' => true,
  179.             'conditions' => '',
  180.             'fields' => '',
  181.             'order' => '',
  182.             'limit' => '',
  183.             'offset' => '',
  184.             'finderQuery' => '',
  185.             'deleteQuery' => '',
  186.             'insertQuery' => ''
  187.         ),
  188.         'RestaurantChain' => array(
  189.             'className' => 'RestaurantChain',
  190.             'joinTable' => 'restaurant_chains_restaurants',
  191.             'foreignKey' => 'restaurant_id',
  192.             'associationForeignKey' => 'restaurant_chain_id',
  193.             'unique' => true,
  194.             'conditions' => '',
  195.             'fields' => '',
  196.             'order' => '',
  197.             'limit' => '',
  198.             'offset' => '',
  199.             'finderQuery' => '',
  200.             'deleteQuery' => '',
  201.             'insertQuery' => ''
  202.         ),
  203.         'Type' => array(
  204.             'className' => 'Type',
  205.             'joinTable' => 'restaurants_types',
  206.             'foreignKey' => 'restaurant_id',
  207.             'associationForeignKey' => 'type_id',
  208.             'unique' => true,
  209.             'conditions' => '',
  210.             'fields' => '',
  211.             'order' => '',
  212.             'limit' => '',
  213.             'offset' => '',
  214.             'finderQuery' => '',
  215.             'deleteQuery' => '',
  216.             'insertQuery' => ''
  217.         ),
  218.         'User' => array(
  219.             'className' => 'User',
  220.             'joinTable' => 'restaurants_users',
  221.             'foreignKey' => 'restaurant_id',
  222.             'associationForeignKey' => 'user_id',
  223.             'unique' => true,
  224.             'conditions' => '',
  225.             'fields' => '',
  226.             'order' => '',
  227.             'limit' => '',
  228.             'offset' => '',
  229.             'finderQuery' => '',
  230.             'deleteQuery' => '',
  231.             'insertQuery' => ''
  232.         )
  233.     );
  234.  
  235. }
  236. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement