I'm not sure if it was me doing something wrong, but I found an
annoying side-effect of this.
If you want to dynamically bind associations, binding occurs on the
entire model - which is shared.
So if you have:

class Company extends AppModel {
  var $hasOne = array(
    'Logo' => array('className' => 'Image', 'foreignKey' =>
'owner_id', 'conditions' => 'Logo.type=\'logo\' AND Logo.owner_type=
\'company\''),
    'Map' => array('className' => 'Image', 'foreignKey' => 'owner_id',
'conditions' => 'Map.type=\'map\' AND Map.owner_type=\'company\''),
  )
}

then inside companies_controller you do:

$this->Company->Logo->bindModel(array('belongsTo'  => array(...)));

This affects both $this->Company->Logo and $this->Company->Map, since
they are the same model.

Still, this really wasn't thought out and might be down to my bad
design in the first place - I was only experimenting.

On 26 Jul, 20:09, bingomanatee <[EMAIL PROTECTED]> wrote:
> The opportunity for caching model objects as singletons in the
> ClasssRepository exists; is there any reason why this should NOT be
> done? Can this create any conflicts that might sabotage your code?


--~--~---------~--~----~------------~-------~--~----~
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