public function getOriginalWithWatermark(AbstractFileEntity $entity, $mode, $optimize = true) { switch ($mode) { case 'path': return $entity->getPath(); case 'url': return $entity->getUrl(); default: throw new \LogicException(); } }