usingTextToNumeric

@param   string $column
@param   string $type

@return  string
557000
protected function usingTextToNumeric($column, $type)
    {
        $type = strtolower($type);

        $details = $this->getColumnDetail($column);

        list($originType) = explode('(', $details->Type);

        $textTypes = [
            PostgresqlType::TEXT,
            PostgresqlType::CHAR,
            PostgresqlType::CHARACTER,
            PostgresqlType::VARCHAR,
        ];

        $numericTypes = [
            PostgresqlType::INTEGER,
            PostgresqlType::SMALLINT,
            PostgresqlType::FLOAT,
            PostgresqlType::DOUBLE,
            PostgresqlType::DECIMAL,
        ];

        if (in_array($originType, $textTypes, true) && in_array($type, $numericTypes, true)) {
            return sprintf('USING trim(%s)::%s', $this->db->quoteName($column), $type);
        }

        return null;
    }
870310
protected function _DefineColumn($Column) {
      if (!is_array($Column->Type) && !in_array($Column->Type, array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'char', 'varchar', 'varbinary', 'date', 'datetime', 'mediumtext', 'longtext', 'text', 'decimal', 'numeric', 'float', 'double', 'enum', 'timestamp', 'tinyblob', 'blob', 'mediumblob', 'longblob')))
         throw new Exception(sprintf(T('The specified data type (%1$s) is not accepted for the MySQL database.'), $Column->Type));
      
      $Return = '`'.$Column->Name.'` '.$Column->Type;
      
      $LengthTypes = $this->Types('length');
      if ($Column->Length != '' && in_array(strtolower($Column->Type), $LengthTypes)) {
         if($Column->Precision != '')
            $Return .= '('.$Column->Length.', '.$Column->Precision.')';
         else
            $Return .= '('.$Column->Length.')';
      }
      if (property_exists($Column, 'Unsigned') && $Column->Unsigned) {
         $Return .= ' unsigned';
      }

      if (is_array($Column->Enum))
         $Return .= "('".implode("','", $Column->Enum)."')";

      if (!$Column->AllowNull)
         $Return .= ' not null';

      if (!(is_null($Column->Default) || $Column->Default === '') && strcasecmp($Column->Type, 'timestamp') != 0)
         $Return .= " default ".self::_QuoteValue($Column->Default);

      if ($Column->AutoIncrement)
         $Return .= ' auto_increment';

      return $Return;
   }
128292
public function orWhereIs(string $column)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereIs($column);

        return $instance;
    }
492571
private static function generateDecimalInput($column)
    {
        $fieldInput = $column->getName().':decimal,'.$column->getPrecision().','.$column->getScale();

        return $fieldInput;
    }
537263
public function getInlineTitleField($column)
    {
        return TextField::create($column, false)
            ->setAttribute('placeholder', _t(__CLASS__.'.TITLE', 'Title'))
            ->setAttribute('data-placeholder', _t(__CLASS__.'.TITLE', 'Title'));
    }
973362
public function unixTimestamp( $column )
    {
        $column = $this->getIdentifier( $column );

        if ( $column != 'NOW()' )
        {
            $column = "CAST( {$column} AS TIMESTAMP )";
//            // alternative
//            if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $column ) ) {
//                $column = "TO_TIMESTAMP( {$column}, 'YYYY-MM-DD HH24:MI:SS' )";
//            }
        }

        $date1 = "CAST( SYS_EXTRACT_UTC( {$column} ) AS DATE )";
        $date2 = "TO_DATE( '19700101000000', 'YYYYMMDDHH24MISS' )";
        return " ROUND( ( {$date1} - {$date2} ) / ( 1 / 86400 ) ) ";
    }
1211234
protected function mapColumnTypeToFieldType(Column $column)
    {
        foreach ($this->typesMap as $type => $classes) {
            if (in_array($typeClass = $this->columnType($column), $classes, true)) {
                if ('StringType' === $typeClass) {
                    if (connection('mysql') && null === $column->getLength()) {
                        return 'radio';
                    }
                }

                return $type;
            }
        }

        return 'text';
    }
412142
public function getColumnType($table, $column)
    {
        $table = $this->connection->getTablePrefix().$table;

        return $this->connection->getDoctrineColumn($table, $column)->getType()->getName();
    }
1014721
public function bindColumn($column, &$param, $type = PDO::PARAM_STR, $maxlen = -1, $driverdata = null) {
		$type = $this->removeBitFlag($$type, PDO::PARAM_INPUT_OUTPUT);
		$ociParamType = $this->pdo2OciParamConst($type);
		// LOBs
		if ($lob_desc = $this->oci_lob_desc($ociParamType)) {
			$this->_lobs[$this->_lobsCount]['type'] = $ociParamType;
			$this->_lobs[$this->_lobsCount]['lob'] = @oci_new_descriptor($this->ociPdoAdapter->getOciConnection(), $lob_desc);
			$res = $this->_lobs[$this->_lobsCount]['lob'];
			$this->checkError($res);
			$res = @oci_define_by_name($this->stmt, $column, $this->_lobs[$this->_lobsCount]['lob'], $ociParamType);
			$this->checkError($res);
			$this->_lobs[$this->_lobsCount]['var'] = $param;
			$this->_lobs[$this->_lobsCount]['input'] = false;

			$this->_lobsCount++;
		}
		else {
			$res = @oci_define_by_name($this->stmt, $column, $param, $ociParamType);
			$this->checkError($res);
		}

		return $res;
	}
293768
protected function getDoctrineColumnType($type)
	{
		$type = strtolower($type);

		switch ($type) {
			case 'biginteger':
				$type = 'bigint';
				break;
			case 'smallinteger':
				$type = 'smallint';
				break;
			case 'mediumtext':
			case 'longtext':
				$type = 'text';
				break;
		}

		return Type::getType($type);
	}
1311580
protected function addTranslatedColumnSetter(Column $column)
    {
        $i18nTablePhpName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($this->behavior->getI18nTable()));
        $tablePhpName = $this->builder->getObjectClassName();
        $objectBuilder = $this->builder->getNewObjectBuilder($this->behavior->getI18nTable());
        $comment = '';
        $functionStatement = '';
        if ($this->isDateType($column->getType())) {
            $objectBuilder->addTemporalMutatorComment($comment, $column);
            $objectBuilder->addMutatorOpenOpen($functionStatement, $column);
        } else {
            $objectBuilder->addMutatorComment($comment, $column);
            $objectBuilder->addMutatorOpenOpen($functionStatement, $column);
        }
        $comment = preg_replace('/^\t/m', '', $comment);
        $comment = str_replace('@return     $this|' . $i18nTablePhpName, '@return     $this|' . $tablePhpName, $comment);
        $functionStatement = preg_replace('/^\t/m', '', $functionStatement);
        preg_match_all('/\$[a-z]+/i', $functionStatement, $params);

        return $this->behavior->renderTemplate('objectTranslatedColumnSetter', [
            'comment'           => $comment,
            'functionStatement' => $functionStatement,
            'columnPhpName'     => $column->getPhpName(),
            'params'            => implode(', ', $params[0]),
        ]);
    }
1276926
protected function generatableColumn($type, Fluent $column)
    {
        if (! $column->autoIncrement && is_null($column->generatedAs)) {
            return $type;
        }

        if ($column->autoIncrement && is_null($column->generatedAs)) {
            return with([
                'integer' => 'serial',
                'bigint' => 'bigserial',
                'smallint' => 'smallserial',
            ])[$type];
        }

        $options = '';

        if (! is_bool($column->generatedAs) && ! empty($column->generatedAs)) {
            $options = sprintf(' (%s)', $column->generatedAs);
        }

        return sprintf(
            '%s generated %s as identity%s',
            $type,
            $column->always ? 'always' : 'by default',
            $options
        );
    }
133098
protected function getColumnSqlDefinition(Column $column)
    {
        if ($column->getType() instanceof Literal) {
            $def = (string)$column->getType();
        } else {
            $sqlType = $this->getSqlType($column->getType(), $column->getLimit());
            $def = strtoupper($sqlType['name']);
        }
        if ($column->getPrecision() && $column->getScale()) {
            $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')';
        } elseif (isset($sqlType['limit'])) {
            $def .= '(' . $sqlType['limit'] . ')';
        }
        if (($values = $column->getValues()) && is_array($values)) {
            $def .= "('" . implode("', '", $values) . "')";
        }
        $def .= $column->getEncoding() ? ' CHARACTER SET ' . $column->getEncoding() : '';
        $def .= $column->getCollation() ? ' COLLATE ' . $column->getCollation() : '';
        $def .= (!$column->isSigned() && isset($this->signedColumnTypes[$column->getType()])) ? ' unsigned' : '';
        $def .= ($column->isNull() == false) ? ' NOT NULL' : ' NULL';
        $def .= $column->isIdentity() ? ' AUTO_INCREMENT' : '';
        $def .= $this->getDefaultValueDefinition($column->getDefault(), $column->getType());

        if ($column->getComment()) {
            $def .= ' COMMENT ' . $this->getConnection()->quote($column->getComment());
        }

        if ($column->getUpdate()) {
            $def .= ' ON UPDATE ' . $column->getUpdate();
        }

        return $def;
    }
947840
public function getColumn(string $column)
    {
        return isset($this->columnData[$column]) ? $this->columnData[$column] : null;
    }
1194103
protected function _getFloatColumn(Column\Float $column)
    {
        if (is_null($column->getDecimal())) {
            return sprintf(
                '%s FLOAT(%s)',
                $column->getName(),
                $column->getDigits()
            );
        }

        return sprintf(
            '%s DECIMAL(%s, %s)',
            $column->getName(),
            $column->getDigits(),
            $column->getDecimal()
        );
    }
645856
public function getColumnName( $column )
    {
        if ( $this->getColumnsUseTranslation() )
        {
            $column = $this->view->translate(
                $this->getColumnId( $column ),
                $this->getColumnTranslateTextDomain()
            );
        }

        return $column;
    }
1199729
public function orderBy($column, $type = 'asc')
    {
        if (! is_null($this->order)) {
            return $this;
        }

        if (!in_array($type, ['asc', 'desc'])) {
            $type = 'asc';
        }

        $this->order = 'order by `'.$column.'` '.$type;

        return $this;
    }