I have been extending DataObjects using the model override described here. However, I’ve been experiencing an issue where newly created instances don’t have access to the override methods.
For example, the following code causes the error “
Call to undefined method overrideMethod in class Pimcore\Model\DataObject\Item”:
$item = new Item(); $item->overrideMethod();
but when instances are retrieved via the API, like in the following code, I get no errors.
$item = Item::getById($id); $item->overrideMethod();
I have looked in the documentation to try and figure out why this would be the case, but cannot see anything that mentions this particular hiccup that I’ve been experiencing.
Does anyone have any thoughts on why I’ve been having this error?