S0RIEN/DataGridBundle — Issue #46: Comtainers / Request in Callback?
Author: print
Created: 2011-10-18 15:36:36+00:00
State: open

Hi,

i search for a way to call the request data inside my callback but i have no direct idea what's the right way to do this.

I think i have to extend the Source class, but im not sure is it necessary?

// Sorien\DataGridBundle\Grid\Source\Source.php
public function prepareQuery($queryBuilder)
{
if (isset($this->callbacks[$this::EVENT_PREPARE_QUERY]) && is_callable($this->callbacks[$this::EVENT_PREPARE_QUERY]))
{
call_user_func($this->callbacks[$this::EVENT_PREPARE_QUERY], $queryBuilder, ?MYEXTRAPARAM?);
}
}

Or is the request ($this->get('request')... doesen't work for me) already defined in my callback?

Thank's for the time!