To skip my rants, just skip to the bottom (refined question after 12 hours 
of debugging...)

@Ivane, thanks for the idea. I just might look into it one day, since 
everybody is talking about it. But as far as I understand, Doctrine can 
only be a full replacement for the CakePHP Model. This plugin is actually 
kind of a "driver" for Cake Models to use MongoDB. It should work just as a 
SQL driver would and the goal is to get it working with Cake's Model 
implementation.

Anyways, I have already found a "simple" and pretty obvious solution.

I have created the MongodbAppModel (in Plugin/Model) and extended the 
_saveMulti() method which was causing issues. This means that, if you wish 
to use the MongoDB and HABTM relations, you have to define your models as 
*Article 
extends MongodbAppModel*, instead of *Article extends AppModel *which is 
pretty much against convention, but makes sense since saving related data 
is MUCH simpler in Mongo. If the model is using an SQL datasource, the 
methods fall back to AppModel, so you could basically leave MongodbAppModel 
as the base model even with SQL drivers. It feels stupid doing it this way, 
but I guess it's a small price to pay to use NoSQL on a predominantly SQL 
platform.

I am still searching for a better idea, so please share some thoughts. 

Here's the refined question: 

*Is there a way to work around (override) the Model::_saveMulti() method 
from a Behavior or DboSource?*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to