Can someone explain why toArray has been replaced by getValueMap:
This is basically the same thing, except the object is harder to use than the array. I am having to modify hundreds of lines of code in my extensions and customizations to deal with this, and I am doing the following to make it work:
I don't see how this is an improvement, and it is causing a ton of work for me. I know the getValueMap function has been around for a long time, but I never switched because it runs much more slowly than simply using toArray.
Code:
public function getValueMap(): stdClass { $array = $this->toArray(); return (object) $array; }
Code:
$arr = (array)$entity->getValueMap();
Comment