public function bind(AbstractAdmin $admin, Request $request)
    {
        if ($this->request) {
            throw new \RuntimeException('A datagrid can only be bound once to a request');
        }

        // configure our datagrid
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($admin->getDatagridOptions());

        $this->admin = $admin;
        $this->request = $request;

        // attach our fields, filters and actions
        $this->admin->buildDatagrid($this);

        $this->applyFilters();
    }
public function bind(AbstractAdmin $admin, Request $request)
    {
        if ($this->request) {
            throw new \RuntimeException('A datagrid can only be bound once to a request');
        }

        // configure our datagrid
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($admin->getDatagridOptions());

        $this->admin = $admin;
        $this->request = $request;

        // attach our fields, filters and actions
        $this->admin->buildDatagrid($this);

        $this->applyFilters();
    }
public function bind ( AbstractAdmin $ admin , Request $ request ) { if ( $ this -> request ) { throw new \ RuntimeException ( 'A datagrid can only be bound once to a request' ) ; } // configure our datagrid $ resolver = new OptionsResolver ( ) ; $ this -> configureOptions ( $ resolver ) ; $ this -> options = $ resolver -> resolve ( $ admin -> getDatagridOptions ( ) ) ; $ this -> admin = $ admin ; $ this -> request = $ request ; // attach our fields, filters and actions $ this -> admin -> buildDatagrid ( $ this ) ; $ this -> applyFilters ( ) ; }
Bind the Request to the Datagrid

@param \Symfony\Component\HttpFoundation\Request $request
Bind the Request to the Datagrid