Newscoop\Service\Implementation\ArticleTypeServiceDoctrine::findTypeByName PHP Method

findTypeByName() public method

public findTypeByName ( $name )
    public function findTypeByName($name)
    {
        $qb = $this->getManager()->createQueryBuilder();
        $qb->select(self::ALIAS)->from('\\Newscoop\\Entity\\ArticleType', self::ALIAS)->where(" ( " . self::ALIAS . ".fieldName IS NULL OR " . self::ALIAS . ".fieldName = 'NULL' ) AND " . self::ALIAS . '.name = ?1')->setParameter(1, $name);
        if (!($res = @current($qb->getQuery()->getResult())) instanceof ArticleType) {
            return null;
        }
        return $res;
    }