Sonata\Exporter\Source\DoctrineORMQuerySourceIterator::__construct PHP Метод

__construct() публичный Метод

public __construct ( Doctrine\ORM\Query $query, array $fields, string $dateTimeFormat = 'r' )
$query Doctrine\ORM\Query The Doctrine Query
$fields array Fields to export
$dateTimeFormat string
    public function __construct(Query $query, array $fields, $dateTimeFormat = 'r')
    {
        $this->query = clone $query;
        $this->query->setParameters($query->getParameters());
        foreach ($query->getHints() as $name => $value) {
            $this->query->setHint($name, $value);
        }
        $this->propertyAccessor = PropertyAccess::createPropertyAccessor();
        $this->propertyPaths = array();
        foreach ($fields as $name => $field) {
            if (is_string($name) && is_string($field)) {
                $this->propertyPaths[$name] = new PropertyPath($field);
            } else {
                $this->propertyPaths[$field] = new PropertyPath($field);
            }
        }
        $this->dateTimeFormat = $dateTimeFormat;
    }