DynamicActiveRecord.php
public static function columnExpression($name, $type = 'char')
    {
        $sql = '[[' . static::dynamicColumn() . ']]';
        $parts = explode('.', $name);
        $lastPart = array_pop($parts);
        foreach ($parts as $column) {
            $sql = "COLUMN_GET($sql, '$column' AS BINARY)";
        }
        $sql = "COLUMN_GET($sql, '$lastPart' AS $type)";

        return $sql;
    }
public static function columnExpression($name, $type = 'char')
    {
        $sql = '[[' . static::dynamicColumn() . ']]';
        $parts = explode('.', $name);
        $lastPart = array_pop($parts);
        foreach ($parts as $column) {
            $sql = "COLUMN_GET($sql, '$column' AS BINARY)";
        }
        $sql = "COLUMN_GET($sql, '$lastPart' AS $type)";

        return $sql;
    }
public static function columnExpression ( $ name , $ type = 'char' ) { $ sql = '[[' . static :: dynamicColumn ( ) . ']]' ; $ parts = explode ( '.' , $ name ) ; $ lastPart = array_pop ( $ parts ) ; foreach ( $ parts as $ column ) { $ sql = "COLUMN_GET($sql, '$column' AS BINARY)" ; } $ sql = "COLUMN_GET($sql, '$lastPart' AS $type)" ; return $ sql ; }
Generate an SQL expression referring to the given dynamic column.

@param string $name Attribute name
@param string $type SQL datatype type

@return string a Maria COLUMN_GET expression
Generate an SQL expression referring to the given dynamic column .