Author: Russ
Date: 2010-02-23 14:30:34 +0100 (Tue, 23 Feb 2010)
New Revision: 28210

Modified:
   
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
Log:
[1.4][sfDoctrine2Plugin] Add limit and hydrate options to runDql task


Modified: 
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
===================================================================
--- 
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
   2010-02-23 12:39:51 UTC (rev 28209)
+++ 
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
   2010-02-23 13:30:34 UTC (rev 28210)
@@ -32,6 +32,8 @@
       new sfCommandOption('dql', null, sfCommandOption::PARAMETER_REQUIRED, 
'The SQL query to execute'),
       new sfCommandOption('file', null, sfCommandOption::PARAMETER_REQUIRED, 
'The path to a SQL file to execute'),
       new sfCommandOption('depth', null, sfCommandOption::PARAMETER_REQUIRED, 
'The depth to allow the data to output to'),
+      new sfCommandOption('limit', null, sfCommandOption::PARAMETER_REQUIRED, 
'Limit the returned results'),
+      new sfCommandOption('hydrate', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'The hydration mode 
(object/array/scalar)', "object"),
     ));
 
     $this->aliases = array();
@@ -42,7 +44,7 @@
     $this->detailedDescription = <<<EOF
 The [doctrine:run-dql|INFO] task executes a DQL:
 
-  [./symfony doctrine:run-dql --dql="SELECT u FROM User"|INFO]
+  [./symfony doctrine:run-dql --dql="SELECT u FROM User u"|INFO]
 
 EOF;
   }
@@ -63,6 +65,16 @@
       $args[] = '--depth='.$options['depth'];
     }
 
+    if (isset($options["limit"]))
+    {
+      $args[] = '--limit='.$options["limit"];
+    }
+
+    if (isset($options["hydrate"]))
+    {
+      $args[] = '--hydrate='.$options["hydrate"];
+    }
+
     $this->callDoctrineCli('Orm:run-dql', $args);
   }
 }
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to