Commit f998aff6 authored by zYne's avatar zYne

added Firebird exception class

parent 6239c4b3
...@@ -107,17 +107,18 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -107,17 +107,18 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
$type = array(); $type = array();
$unsigned = $fixed = null; $unsigned = $fixed = null;
$db_type = strtolower($field['type']); $dbType = strtolower($field['type']);
$field['field_sub_type'] = !empty($field['field_sub_type']) $field['field_sub_type'] = !empty($field['field_sub_type'])
? strtolower($field['field_sub_type']) : null; ? strtolower($field['field_sub_type']) : null;
switch ($db_type) {
switch ($dbType) {
case 'smallint': case 'smallint':
case 'integer': case 'integer':
case 'int64': case 'int64':
//these may be 'numeric' or 'decimal' //these may be 'numeric' or 'decimal'
if (isset($field['field_sub_type'])) { if (isset($field['field_sub_type'])) {
$field['type'] = $field['field_sub_type']; $field['type'] = $field['field_sub_type'];
return $this->mapNativeDatatype($field); return $this->getPortableDeclaration($field);
} }
case 'bigint': case 'bigint':
case 'quad': case 'quad':
...@@ -171,7 +172,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -171,7 +172,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
$length = null; $length = null;
break; break;
default: default:
throw new Doctrine_DataDict_Firebird_Exception('unknown database attribute type: '.$db_type); throw new Doctrine_DataDict_Firebird_Exception('unknown database attribute type: '.$dbType);
} }
return array($type, $length, $unsigned, $fixed); return array($type, $length, $unsigned, $fixed);
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_DataDict_Exception');
/**
* Doctrine_DataDict_Sqlite_Exception
*
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_DataDict_Firebird_Exception extends Doctrine_DataDict_Exception
{ }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment