Exemplo n.º 1
0
 /**
  * 
  * Return the definition array for a column.
  * 
  * @access private
  * 
  * @param string $backend The name of the backend ('db' or 'mdb2').
  * 
  * @param string $phptype The DB/MDB2 phptype key.
  * 
  * @param mixed $column A single DB_Table column definition array.
  * 
  * @return mixed|object Declaration string (DB), declaration array (MDB2) or a
  * PEAR_Error with a description about the invalidity, otherwise.
  * 
  */
 function _getColumnDefinition($backend, $phptype, $column)
 {
     static $max_scope;
     // prepare variables
     $type = isset($column['type']) ? $column['type'] : null;
     $size = isset($column['size']) ? $column['size'] : null;
     $scope = isset($column['scope']) ? $column['scope'] : null;
     $require = isset($column['require']) ? $column['require'] : null;
     $default = isset($column['default']) ? $column['default'] : null;
     if ($backend == 'db') {
         return DB_Table_Manager::getDeclare($phptype, $type, $size, $scope, $require, $default);
     } else {
         return DB_Table_Manager::getDeclareMDB2($type, $size, $scope, $require, $default, $max_scope);
     }
 }