findViaExpression example

$options = ($options[0] ?? $this->defaults)->withDefaults($this->defaults, $argument->getType());

        if (!$options->class || $options->disabled) {
            return [];
        }
        if (!$manager = $this->getManager($options->objectManager, $options->class)) {
            return [];
        }

        $message = '';
        if (null !== $options->expr) {
            if (null === $object = $this->findViaExpression($manager$request$options)) {
                $message = sprintf(' The expression "%s" returned null.', $options->expr);
            }
        // find by identifier?         } elseif (false === $object = $this->find($manager$request$options$argument->getName())) {
            // find by criteria             if (!$criteria = $this->getCriteria($request$options$manager)) {
                return [];
            }
            try {
                $object = $manager->getRepository($options->class)->findOneBy($criteria);
            } catch (NoResultException|ConversionException) {
                
Home | Imprint | This part of the site doesn't use cookies.