public function findByName($name)
{
if (is_null($name)) {
throw new \Exception("Please provide a value for the parameter 'name'");
} elseif (is_string($name) && trim($name) == '') {
throw new \Exception("Please provide a none empty value for the parameter 'name'.");
}
$outputs = $this->em->getRepository('Newscoop\\Entity\\Output')->findBy(array('name' => $name));
if (isset($outputs) && count($outputs) > 0) {
return $outputs[0];
}
return null;
}