saving model with "with"

0 views
Skip to first unread message

slawil

unread,
Nov 17, 2007, 5:11:04 AM11/17/07
to CakePHP Bleeding Edge
Hi,

In cake 1.2 we can now setting "with" key for HABTM. That's work fine
for raed and findAll, but how makes it work with save() without making
new model?

Example:
- Articles (some fileds)
- Tags (some fileds)
- ArticlesTags ( article_id,tag_id, piority)

If we want to save tags by Article model we are making something like
this:

$data['Article'] = $someData;
$data['Tags']['Tags'][] = $tag_id
$this->Article->save($data);

How we can pass value for piority ?


Or if we made model ArticlesTag (and articles_tags table don't have
"id" field PK) how we can save piority for article_tag=1 tag_id=2 ?


Do we have some "cake's way" to do this without model (or model with
PK "id") ?





Reply all
Reply to author
Forward
0 new messages