Changeset 3673

Show
Ignore:
Timestamp:
01/29/08 23:19:20 (17 months ago)
Author:
guilhermeblanco
Message:

Merged changeset #3621 into 0.9 and 0.10 branches. Fixed ws in trunk

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Task/Dql.php

    r3672 r3673  
    3737                                           'dql_query' => 'Specify the complete dql query to execute.'), 
    3838           $optionalArguments    =   array(); 
    39      
     39 
    4040    public function execute() 
    4141    { 
    4242        Doctrine::loadModels($this->getArgument('models_path')); 
    43          
     43 
    4444        $dql = $this->getArgument('dql_query'); 
    45          
     45 
    4646        $query = new Doctrine_Query(); 
    47          
    48         $this->notify('executing: "' . $dql . '"'); 
    49          
    50         $results = $query->query($dql); 
    51          
     47 
     48        $params = explode(',', $this->getArgument('params')); 
     49 
     50        $this->notify('executing: "' . $dql . '" (' . implode(', ', $params) . ')'); 
     51 
     52        $results = $query->query($dql, $params); 
     53 
    5254        $this->_printResults($results); 
    5355    } 
    54      
     56 
    5557    protected function _printResults($data) 
    5658    { 
    5759        $array = $data->toArray(true); 
    58          
     60 
    5961        $yaml = Doctrine_Parser::dump($array, 'yml'); 
    6062        $lines = explode("\n", $yaml); 
    61          
     63 
    6264        unset($lines[0]); 
    6365        $lines[1] = $data->getTable()->getOption('name') . ':'; 
    64          
     66 
    6567        foreach ($lines as $yamlLine) { 
    6668            $line = trim($yamlLine); 
    67              
     69 
    6870            if ($line) { 
    6971                $this->notify($yamlLine); 
  • branches/0.9/lib/Doctrine/Task/Dql.php

    r3672 r3673  
    4141    { 
    4242        Doctrine::loadModels($this->getArgument('models_path')); 
    43          
     43 
    4444        $dql = $this->getArgument('dql_query'); 
    45          
     45 
    4646        $query = new Doctrine_Query(); 
    47          
    48         $this->notify('executing: "' . $dql . '"'); 
    49          
    50         $results = $query->query($dql); 
    51          
     47 
     48        $params = explode(',', $this->getArgument('params')); 
     49 
     50        $this->notify('executing: "' . $dql . '" (' . implode(', ', $params) . ')'); 
     51 
     52        $results = $query->query($dql, $params); 
     53 
    5254        $this->_printResults($results); 
    5355    } 
    54      
     56 
    5557    protected function _printResults($data) 
    5658    { 
    5759        $array = $data->toArray(true); 
    58          
     60 
    5961        $yaml = Doctrine_Parser::dump($array, 'yml'); 
    6062        $lines = explode("\n", $yaml); 
    61          
     63 
    6264        unset($lines[0]); 
    6365        $lines[1] = $data->getTable()->getOption('name') . ':'; 
    64          
     66 
    6567        foreach ($lines as $yamlLine) { 
    6668            $line = trim($yamlLine); 
    67              
     69 
    6870            if ($line) { 
    6971                $this->notify($yamlLine); 
  • trunk/lib/Doctrine/Task/Dql.php

    r3624 r3673  
    4949 
    5050        $this->notify('executing: "' . $dql . '" (' . implode(', ', $params) . ')'); 
    51          
     51 
    5252        $results = $query->query($dql, $params); 
    5353