Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
EAV with Nested Set
  • As i told earlier, in My POS Application, I want EAV should be attached to json with every Parent Row

    But when i relating meta with ->related('meta')   it is attached to it. but i cant get the value from json. in json i got 'meta' key.. contain no value.

    is there any way to get all childs with eav attached to json???
  • An EAV container is just a normal one-to-many relation, so I don't see why not.

    // get the parent with all it's children
    $parent = Model_Parent::query()->related('children')->where('id', '=', '1')->get_one();

    // dump all child objects
    var_dump($parent->children);

    Obviously, you need to transform this result to an array with a layout you are happy with, and then convert the resulting array into json.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion