Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- App::uses('AppModel', 'Model');
- class Information extends AppModel {
- public $useTable = 'informations';
- public $displayField = 'name';
- public $validate = array(
- 'name' => array(
- 'notempty' => array(
- 'rule' => array('notempty'),
- 'message' => 'The field name can not be empty',
- ),
- ),
- 'lastname' => array(
- 'notempty' => array(
- 'rule' => array('notempty'),
- 'message' => 'The field lastname can not be empty',
- ),
- ),
- 'email' => array(
- 'email' => array(
- 'rule' => array('email'),
- 'message' => 'The email address is not correct',
- ),
- ),
- );
- public $belongsTo = array(
- 'Country' => array(
- 'className' => 'Country',
- 'foreignKey' => 'countries_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- )
- );
- public $hasMany = array(
- 'Educations' => array(
- 'className' => 'Education',
- 'foreignKey' => 'informations_id',
- 'dependent' => true
- ),
- 'Experiences' => array(
- 'className' => 'Experience',
- 'foreignKey' => 'informations_id',
- 'dependent' => true
- ),
- 'Attachments' => array(
- 'className' => 'Attachment',
- 'foreignKey' => 'informations_id',
- 'dependent' => true
- )
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement