FieldAccessorBuilderNotFoundException example



        $parentSelect = $this->buildFieldSelector($root . '.parent', $field$context$original);

        return sprintf('IFNULL(%s, %s)', $select$parentSelect);
    }

    private function buildFieldSelector(string $root, Field $field, Context $context, string $accessor): string
    {
        $accessorBuilder = $field->getAccessorBuilder();
        if (!$accessorBuilder) {
            throw new FieldAccessorBuilderNotFoundException($field->getPropertyName());
        }

        $accessor = $accessorBuilder->buildAccessor($root$field$context$accessor);

        if (!$accessor) {
            throw new \RuntimeException(sprintf('Can not build accessor for field "%s" on root "%s"', $field->getPropertyName()$root));
        }

        return $accessor;
    }
}
Home | Imprint | This part of the site doesn't use cookies.