Nette\Database\Connection::getSupplementalDriver PHP Method

getSupplementalDriver() public method

public getSupplementalDriver ( ) : Nette\Database\ISupplementalDriver
return Nette\Database\ISupplementalDriver
    public function getSupplementalDriver()
    {
        $this->connect();
        return $this->driver;
    }

Usage Example

Example #1
0
 /**
  * Normalizes result row.
  * @param  array
  * @return array
  */
 public function normalizeRow($row)
 {
     if ($this->types === NULL) {
         $this->types = array();
         if ($this->connection->getSupplementalDriver()->supports['meta']) {
             // workaround for PHP bugs #53782, #54695
             $col = 0;
             foreach ($row as $key => $foo) {
                 $type = $this->getColumnMeta($col++);
                 if (isset($type['native_type'])) {
                     $this->types[$key] = Reflection\DatabaseReflection::detectType($type['native_type']);
                 }
             }
         }
     }
     foreach ($this->types as $key => $type) {
         $value = $row[$key];
         if ($value === NULL || $value === FALSE || $type === Reflection\DatabaseReflection::FIELD_TEXT) {
         } elseif ($type === Reflection\DatabaseReflection::FIELD_INTEGER) {
             $row[$key] = is_float($tmp = $value * 1) ? $value : $tmp;
         } elseif ($type === Reflection\DatabaseReflection::FIELD_FLOAT) {
             $row[$key] = (string) ($tmp = (double) $value) === $value ? $tmp : $value;
         } elseif ($type === Reflection\DatabaseReflection::FIELD_BOOL) {
             $row[$key] = (bool) $value && $value !== 'f' && $value !== 'F';
         }
     }
     return $this->connection->getSupplementalDriver()->normalizeRow($row, $this);
 }
All Usage Examples Of Nette\Database\Connection::getSupplementalDriver