CakePHP Model hasOne association


/ Published in: PHP
Save to your folder(s)

This class var definition configures a Model to have a OneToOne relationship with a Model of another class.


Copy this code and paste it in your HTML
  1. var $hasOne = array('Model' => array(
  2. 'className' => 'Model',
  3. 'conditions' => '',
  4. 'order' => '',
  5. 'dependent' => true,
  6. 'foreignKey' => ''
  7. ));

URL: http://manual.cakephp.org/chapter/models

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.