Find definition that match the given id.

@param  string  $name

@throws \InvalidArgumentException

@return \Illuminate\Support\Fluent
429360
public function find(string $name)
    {
        if (! \array_key_exists($name, $this->keyMap)) {
            throw new InvalidArgumentException("Name [{$name}] is not available.");
        }

        return $this->controls[$this->keyMap[$name]];
    }
356210
public function findOneByName($name)
    {
        $entityClass = $this->getEntityClass();

        return $this->getObjectManager()
                    ->getRepository($entityClass)
                    ->findOneByName($name);
    }
965982
public function findOneByName($name)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->andWhere($qb->expr()->eq('b.name', ':name'))
            ->andWhere($qb->expr()->isNull('b.row'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Block::getEntityTagPrefix() . '[name:'.$name.']')
            ->setParameter('name', $name)
            ->getOneOrNullResult();
    }
1071376
public function get($name)
    {
        if (!isset($this->helpers[$name])) {
            throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
        }

        return $this->helpers[$name];
    }
589124
public function findNeedByName($name)
    {
        // No needs defined yet.
        if (is_null($this->needs)) {
            return null;
        }

        // Traverse and Return.
        return $this->traverseNodesAndFindBy('name', $name, $this->needs);
    }
824628
public function get($name)
    {
        $toggle = $this->collection->get($name);
        if(!$toggle){
            throw new \InvalidArgumentException("Cannot find Toggle with name $name");
        }

        return $toggle;
    }
381157
public function findByName($name)
    {
        $q = $this->createSelectQuery();
        $q->where($q->expr->eq('name', $q->bindValue($name, ':name')));
        return $this->loadOneFromQuery($q);
    }
1295673
public function get($name)
    {
        if (! $this->has($name)) throw new \InvalidArgumentException('no such task');

        $task = new Task($this, $this->getReflection()->getMethod($name . 'Task'));
        return $task;
    }
578875
public function getMethod($name)
    {
        if ($this->hasMethod($name) === true) {
            return $this->methods[$name];
        } else {
            throw new InvalidArgumentException('Method "' . $name . '" is not defined.');
        }
    }
260101
final public function getForeignKey(string $name): ForeignKey
    {
        if (!$this->hasForeignKey($name)) {
            throw new InvalidArgumentException('Foreign key '.$name.' not added.');
        }

        return $this->foreignKeys[$name];
    }
817098
public function searchByName($name) {
		return $this->parameters->search($name, function (Parameter $param, $name) {
			return $param->getName() == $name;
		});
	}
1306104
public function getNamedRoute(string $name): Route
    {
        foreach ($this->getRoutes() as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new InvalidArgumentException('Named route does not exist for name: ' . $name);
    }
1316986
public function findByName( $name )
    {

        // is this name schema qualified
        $call = sprintf(
            "findBy%s",
            ( false !== strpos( $name, '.' ) ) ? 'FullyQualifiedName' : 'Name'
        );

        $found = $this->persistedGet()->$call( $name );

        // return
        switch( $count = count( $found ) ) {
            case 0:
                return null;
            case 1:
                return $found->pop();
            default:
                throw new \LogicException( "{$count} relations' found with name `{$name}`. Ambiguous. Can't proceed." );
        }

    }
317204
protected function searchDefinitionByName($name)
    {
        foreach ($this->getGroupAndSortingDefinition() as $definition) {
            if ($name === $definition->getName()) {
                return $definition;
            }
        }

        return null;
    }
695527
protected function getParam($name)
    {
        if (!isset($this->params[$name])) {
            throw new \InvalidArgumentException("Param is not valid: ".$name);
        }

        return $this->params[$name];
    }
293278
public function findOneByName($name)
    {
        $as = $this->getAlias();
        $qb = $this->getQueryBuilder();

        $qb->andWhere($qb->expr()->eq($as . '.name', ':name'));

        $parameters = ['name' => $name];

        if (0 < strpos($name, ':')) {
            list($rootName, $menuName) = explode(':', $name);

            /** @var \Ekyna\Bundle\CmsBundle\Model\MenuInterface $root */
            if (null === $root = $this->findOneBy(['name' => $rootName])) {
                throw new \InvalidArgumentException(sprintf('Root menu "%s" not found.', $rootName));
            }

            $qb->andWhere($qb->expr()->eq($as . '.root', ':root'));

            $parameters = [
                'name' => $menuName,
                'root' => $root,
            ];
        }

        return $qb
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Menu::getEntityTagPrefix() . '[name=' . $name . ']')
            ->setMaxResults(1)
            ->setParameters($parameters)
            ->getOneOrNullResult();
    }
1000099
public static function lookupByName($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException('Argument "name" cannot be empty');
        }

        if (!isset(self::$methods_config[$name])) {
            throw new \InvalidArgumentException('Method "' . $name . '" doesn\'t exist');
        }

        return self::$methods_config[$name];
    }