protected function load($choices)
    {
        if (\is_array($choices) && \count($choices) > 0) {
            $entities = $choices;
        } elseif ($this->query) {
            $entities = $this->modelManager->executeQuery($this->query);
        } else {
            $entities = $this->modelManager->findBy($this->class);
        }

        if (null === $entities) {
            return [];
        }

        $choices = [];
        $this->entities = [];

        foreach ($entities as $key => $entity) {
            if ($this->propertyPath) {
                // If the property option was given, use it
                $value = $this->propertyAccessor->getValue($entity, $this->propertyPath);
            } else {
                // Otherwise expect a __toString() method in the entity
                try {
                    $value = (string) $entity;
                } catch (\Exception $e) {
                    throw new RuntimeException(sprintf('Unable to convert the entity "%s" to string, provide '
                        .'"property" option or implement "__toString()" method in your entity.', ClassUtils::getClass($entity)), 0, $e);
                }
            }

            if (\count($this->identifier) > 1) {
                // When the identifier consists of multiple field, use
                // naturally ordered keys to refer to the choices
                $choices[$key] = $value;
                $this->entities[$key] = $entity;
            } else {
                // When the identifier is a single field, index choices by
                // entity ID for performance reasons
                $id = current($this->getIdentifierValues($entity));
                $choices[$id] = $value;
                $this->entities[$id] = $entity;
            }
        }

        return $choices;
    }