src/PHPDish/Bundle/AdminBundle/DataGrid/GridFactoryAggregate.php
public function get($sourceClass)
    {
        if (isset($this->factory[$sourceClass])) {
            $factory = $this->factory[$sourceClass];
            $grid = $factory->factory();
        } else {
            $reflection = new \ReflectionClass($sourceClass);
            if (!$reflection->isInstantiable()) {
                throw new \InvalidArgumentException(sprintf('The "%s" cannot be instantiated'));
            }
            $source = new Entity($sourceClass);
            $this->grid->setSource($source);
            $grid = $this->grid;
        }
        //handle request
//        $grid->handleRequest($this->requestStack->getCurrentRequest());
//        dump($grid->getColumns());
        return $grid;
    }
public function get($sourceClass)
    {
        if (isset($this->factory[$sourceClass])) {
            $factory = $this->factory[$sourceClass];
            $grid = $factory->factory();
        } else {
            $reflection = new \ReflectionClass($sourceClass);
            if (!$reflection->isInstantiable()) {
                throw new \InvalidArgumentException(sprintf('The "%s" cannot be instantiated'));
            }
            $source = new Entity($sourceClass);
            $this->grid->setSource($source);
            $grid = $this->grid;
        }
        //handle request
//        $grid->handleRequest($this->requestStack->getCurrentRequest());
//        dump($grid->getColumns());
        return $grid;
    }
获取grid source

@param string $sourceClass
@return Grid
@throws \ReflectionException