Skip to content

Relations and find method #293

@sdrdis

Description

@sdrdis

Lets say I have two models, Model_Test and Model_Tag, Model_Test having a many_to_many relation (named tags) with Model_Tag

$test = \Model_Test::find('first'); // lets say there is at least one Model_Test instance
$test->tags[] = \Model_Tag::forge(array('tag_label' => 'test'));
// <-- If I apply $test->save() here, it works well. $test->get_diff() returns an array with two non-empty elements
\Model_Test::find('first');
// <-- If I apply $test->save() here, the tag relation won't be saved. $test->get_diff() will return an array with two empty elements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions