function findByPathOrId($pathOrId)
{
Validation::notEmpty($pathOrId, 'path');
$em = $this->getManager();
if (is_numeric($pathOrId)) {
$resources = $em->getRepository($this->entityClassName)->findById($pathOrId);
} else {
$resources = $em->getRepository($this->entityClassName)->findByPath($pathOrId);
}
if (isset($resources) && count($resources) > 0) {
return $resources[0];
}
return NULL;
}