Added params argument to allow you to use tokens
This commit is contained in:
parent
8cc89beb41
commit
eb04f52cd0
@ -34,8 +34,8 @@ class Doctrine_Task_Dql extends Doctrine_Task
|
|||||||
{
|
{
|
||||||
public $description = 'Execute dql query and display the results',
|
public $description = 'Execute dql query and display the results',
|
||||||
$requiredArguments = array('models_path' => 'Specify path to your Doctrine_Record definitions.',
|
$requiredArguments = array('models_path' => 'Specify path to your Doctrine_Record definitions.',
|
||||||
'dql_query' => 'Specify the complete dql query to execute.'),
|
'dql_query' => 'Specify the complete dql query to execute.'),
|
||||||
$optionalArguments = array();
|
$optionalArguments = array('params' => 'Comma separated list of the params to replace the ? tokens in the dql');
|
||||||
|
|
||||||
public function execute()
|
public function execute()
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ class Doctrine_Task_Dql extends Doctrine_Task
|
|||||||
|
|
||||||
$this->notify('executing: "' . $dql . '"');
|
$this->notify('executing: "' . $dql . '"');
|
||||||
|
|
||||||
$results = $query->query($dql);
|
$results = $query->query($dql, explode(',', $this->getArgument('params')));
|
||||||
|
|
||||||
$this->printResults($results);
|
$this->printResults($results);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user