Advertisement
Guest User

Untitled

a guest
Feb 24th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. <?php
  2. App::uses('AppModel', 'Model');
  3. class Information extends AppModel {
  4.     public $useTable = 'informations';
  5.     public $displayField = 'name';
  6.     public $validate = array(
  7.         'name' => array(
  8.             'notempty' => array(
  9.                 'rule' => array('notempty'),
  10.                 'message' => 'The field name can not be empty',
  11.             ),
  12.         ),
  13.         'lastname' => array(
  14.             'notempty' => array(
  15.                 'rule' => array('notempty'),
  16.                 'message' => 'The field lastname can not be empty',
  17.             ),
  18.         ),
  19.         'email' => array(
  20.             'email' => array(
  21.                 'rule' => array('email'),
  22.                 'message' => 'The email address is not correct',
  23.             ),
  24.         ),
  25.     );
  26.  
  27.     public $belongsTo = array(
  28.         'Country' => array(
  29.             'className' => 'Country',
  30.             'foreignKey' => 'countries_id',
  31.             'conditions' => '',
  32.             'fields' => '',
  33.             'order' => ''
  34.         )
  35.     );
  36.    
  37.     public $hasMany = array(
  38.             'Educations' => array(
  39.                     'className' => 'Education',
  40.                     'foreignKey' => 'informations_id',
  41.                     'dependent' => true
  42.             ),
  43.             'Experiences' => array(
  44.                     'className' => 'Experience',
  45.                     'foreignKey' => 'informations_id',
  46.                     'dependent' => true
  47.             ),
  48.             'Attachments' => array(
  49.                     'className' => 'Attachment',
  50.                     'foreignKey' => 'informations_id',
  51.                     'dependent' => true
  52.             )
  53.     );
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement