Development

Changeset 24625 for branches

You must first sign up to be able to contribute.

Changeset 24625 for branches

Show
Ignore:
Timestamp:
12/01/09 01:05:40 (3 years ago)
Author:
Kris.Wallsmith
Message:

[1.3, 1.4] updated doctrine:dql task to render NULL for null values when in table mode (closes #7680)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineDqlTask.class.php

    r24150 r24625  
    110110            } 
    111111 
    112             $headers[$field] = max($headers[$field], strlen($value)); 
     112            $headers[$field] = max($headers[$field], strlen($this->renderValue($value))); 
    113113          } 
    114114        } 
     
    137137          foreach ($result as $field => $value) 
    138138          { 
    139             $line .= ' '.str_pad($value, $headers[$field]).' |'; 
     139            $line .= ' '.str_pad($this->renderValue($value), $headers[$field]).' |'; 
    140140          } 
    141141          $this->log($line); 
     
    164164    } 
    165165  } 
     166 
     167  /** 
     168   * Renders the supplied value. 
     169   * 
     170   * @param string|null $value 
     171   * 
     172   * @return string 
     173   */ 
     174  protected function renderValue($value) 
     175  { 
     176    return null === $value ? 'NULL' : $value; 
     177  } 
    166178} 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineDqlTask.class.php

    r24150 r24625  
    109109            } 
    110110 
    111             $headers[$field] = max($headers[$field], strlen($value)); 
     111            $headers[$field] = max($headers[$field], strlen($this->renderValue($value))); 
    112112          } 
    113113        } 
     
    136136          foreach ($result as $field => $value) 
    137137          { 
    138             $line .= ' '.str_pad($value, $headers[$field]).' |'; 
     138            $line .= ' '.str_pad($this->renderValue($value), $headers[$field]).' |'; 
    139139          } 
    140140          $this->log($line); 
     
    163163    } 
    164164  } 
     165 
     166  /** 
     167   * Renders the supplied value. 
     168   * 
     169   * @param string|null $value 
     170   * 
     171   * @return string 
     172   */ 
     173  protected function renderValue($value) 
     174  { 
     175    return null === $value ? 'NULL' : $value; 
     176  } 
    165177}