Propel icon indicating copy to clipboard operation
Propel copied to clipboard

Missing key value Parser

Open YasinMuhammad opened this issue 9 years ago • 2 comments

I have this error when set Child table data $child_obj->setChildDatas(new Collection (array($childData))); and save parent object $obj->save().

Unknown parser class "Propel\Runtime\Parser\KeyvalueParser" any Idea on this

YasinMuhammad avatar Mar 26 '15 10:03 YasinMuhammad

What version of Propel are you using? Can we see the smallest possible script that replicates this problem?

halfer avatar Apr 15 '15 08:04 halfer

I know this is old topic. In our project we had same problem.

When you are using versionable behaviour it is using $object->toKeyValue('Id', 'Version') call. After investigation we found that Collection class does not contains it, so magic function __call tries to use Parser class.

Solution in this case is usage of ObjectCollection class. This class is also used internally in relations.

$child_obj->setChildDatas(new ObjectCollection(array($childData)));
and save parent object $obj->save().

ppatrik avatar Apr 04 '20 15:04 ppatrik