Newscoop\Services\ThemesService::findByName PHP Метод

findByName() публичный Метод

Finds output by name
public findByName ( string $name ) : string | null
$name string Output name ('Web' in this case)
Результат string | null
    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;
    }