it took some time to translate everything into my naming.

basically i have Articles and (Publishing) Rights, associated via
HABTM

code in articles controller:

###

$RightIdList = array(1,2,3); // can be any length
foreach($RightIdList as $rightId){
        $bindArray = array();
        $Alias = rand(); // could be any (unique)string
        $bindArray['hasOne'][$Alias] = array('className'=>'ArticlesRight');
        $this->Article->bindModel($bindArray);
        $constraint[$Alias.'.right_id'] = $rightId;
        }
pr($constraint);exit;

###

the "helper" model called "articlesright.php"

###

class ArticlesRight extends AppModel {

        var $name = 'ArticlesRight';

        var $hasOne = array(
                        'Right' =>
                         array('className'    => 'Right',
                               'joinTable'    => 'articles_rights',
                               'foreignKey'   => 'right_id',
                               'associationForeignKey'=> 'article_id',
                               'conditions'   => '',
                               'order'        => '',
                               'limit'        => '',
                               'unique'       => true,
                               'finderQuery'  => '',
                               'deleteQuery'  => '',
                                         ),
                                );
        }

###

and the framework complains :

Fatal error: Cannot instantiate non-existent class: articlesright in /
var/www/cake/cake/libs/model/model_php4.php on line 445


i can feel i am so close. :-)

jyrgen





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to