[+BUGFIX] Extbase (Persistence): Added check for existing object before get_object_vars() is invoked.
public function getIdentifierByObject($object) {
if (!is_object($object)) throw new InvalidArgumentException('Object expected, ' . gettype($object) . ' given.', 1246892972);
if (!isset($this->objectMap[$object])) {
- throw new Tx_Extbase_Persisitence_Exception_UnknownObjectException('The given object (class: ' . get_class($object) . ') is not registered in this Identity Map.', 1246892970);
+ throw new Tx_Extbase_Persistence_Exception_UnknownObjectException('The given object (class: ' . get_class($object) . ') is not registered in this Identity Map.', 1246892970);
}
return $this->objectMap[$object];
}
return call_user_func(array($object, $getterMethodName));
} elseif ($object instanceof ArrayAccess && isset($object[$propertyName])) {
return $object[$propertyName];
- } elseif (array_key_exists($propertyName, get_object_vars($object))) {
+ } elseif (is_object($object) && array_key_exists($propertyName, get_object_vars($object))) {
return $object->$propertyName;
}
return NULL;