mirror of
https://github.com/getgrav/grav.git
synced 2026-03-04 03:21:33 +01:00
FlexDirectory::getObject() should return any existing object
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user