protected function getTypeById($typeId)
{
/** @var CollectionType $type */
$type = $this->em->getRepository('SuluMediaBundle:CollectionType')->find($typeId);
if (!$type) {
throw new CollectionTypeNotFoundException('Collection Type with the ID ' . $typeId . ' not found');
}
return $type;
}