public static function notEmpty($parameter, $name = 'unknown')
{
if (is_null($parameter)) {
throw new \Exception("Please provide a value for the parameter '{$name}'.");
} else {
if (is_string($parameter) && trim($parameter) == '') {
throw new \Exception("Please provide a none empty value for the parameter '{$name}'.");
}
}
}
function findByName($name) { Validation::notEmpty($name, 'name'); $em = $this->getManager(); $outputs = $em->getRepository($this->entityClassName)->findByName($name); if (isset($outputs) && count($outputs) > 0) { return $outputs[0]; } return NULL; }