Last active
August 29, 2015 14:07
-
-
Save ziplizard/0e22eb0202e81cded8aa to your computer and use it in GitHub Desktop.
Revisions
-
ziplizard revised this gist
Oct 13, 2014 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,11 @@ 'foreignKey' => false, 'conditions' => array('LinkedinPerson.linkedin_id = LinkedinRecommendation.linkedin_id'), ), ); // the find $res = $this->LinkedinPerson->find('first', array('contain'=>array('LinkedinRecommendation'), 'conditions'=>array('LinkedinPerson.id'=>35))); // have also tried $res = $this->Person->find('first', array('contain'=>array('LinkedinPerson.LinkedinRecommendation'), 'conditions'=>array('LinkedinPerson.id'=>35))); // but get error on relationship of LinkedinPerson to LinkedinRecommendation -
ziplizard created this gist
Oct 13, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ <?php // in LinkedinPerson public $hasMany = array( 'LinkedinRecommendation' => array( 'className' => 'LinkedinRecommendation', 'foreignKey' => false, 'dependent' => true, ), ) // in LinkedinRecommendation public $belongsTo = array( 'LinkedinPerson' => array( 'className' => 'LinkedinPerson', 'foreignKey' => false, 'conditions' => array('LinkedinPerson.linkedin_id = LinkedinRecommendation.linkedin_id'), ), );