Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • COciColumnSchema
  • COciCommandBuilder
  • COciSchema
  • COciTableSchema
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * COciColumnSchema class file.
 4:  *
 5:  * @author Ricardo Grana <rickgrana@yahoo.com.br>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * COciColumnSchema class describes the column meta data of an Oracle table.
13:  *
14:  * @author Ricardo Grana <rickgrana@yahoo.com.br>
15:  * @package system.db.schema.oci
16:  */
17: class COciColumnSchema extends CDbColumnSchema
18: {
19:     /**
20:      * Extracts the PHP type from DB type.
21:      * @param string $dbType DB type
22:      * @return string
23:      */
24:     protected function extractOraType($dbType){
25:         if(strpos($dbType,'FLOAT')!==false) return 'double';
26: 
27:         if (strpos($dbType,'NUMBER')!==false || strpos($dbType,'INTEGER')!==false)
28:         {
29:             if(strpos($dbType,'(') && preg_match('/\((.*)\)/',$dbType,$matches))
30:             {
31:                 $values=explode(',',$matches[1]);
32:                 if(isset($values[1]) and (((int)$values[1]) > 0))
33:                     return 'double';
34:                 else
35:                     return 'integer';
36:             }
37:             else
38:                 return 'double';
39:         }
40:         else
41:             return 'string';
42:     }
43: 
44:     /**
45:      * Extracts the PHP type from DB type.
46:      * @param string $dbType DB type
47:      */
48:     protected function extractType($dbType)
49:     {
50:         $this->type=$this->extractOraType($dbType);
51:     }
52: 
53:     /**
54:      * Extracts the default value for the column.
55:      * The value is typecasted to correct PHP type.
56:      * @param mixed $defaultValue the default value obtained from metadata
57:      */
58:     protected function extractDefault($defaultValue)
59:     {
60:         if(stripos($defaultValue,'timestamp')!==false)
61:             $this->defaultValue=null;
62:         else
63:             parent::extractDefault($defaultValue);
64:     }
65: }
66: 
API documentation generated by ApiGen 2.8.0