FlexDirectory::getObject() should return any existing object

This commit is contained in:
Matias Griese
2018-11-30 13:13:13 +02:00
parent e84fbc425f
commit 180f3c2eca

View File

@@ -212,13 +212,17 @@ class FlexDirectory implements FlexAuthorizeInterface
}
/**
* Returns an object if it exists.
*
* Note: It is not safe to use the object without checking if the user can access it.
*
* @param string $key
* @param string|null $keyField Field to be used as the key.
* @return FlexObject|null
*/
public function getObject($key, string $keyField = null) : ?FlexObject
{
return $this->getCollection(null, $keyField)->get($key);
return $this->getIndex(null, $keyField)->get($key);
}
/**