private function createColumn(array $config)
    {
        $colType = isset($config['colType']) ? $config['colType'] : 'Select';
        if (class_exists($colType, true)) {
            $class = $colType;
        } elseif (class_exists('ZfcDatagrid\\Column\\'.$colType, true)) {
            $class = 'ZfcDatagrid\\Column\\'.$colType;
        } else {
            throw new \InvalidArgumentException(sprintf('Column type: "%s" not found!', $colType));
        }

        if ('ZfcDatagrid\\Column\\Select' == $class) {
            if (! isset($config['select']['column'])) {
                throw new \InvalidArgumentException(
                    'For "ZfcDatagrid\Column\Select" the option select[column] must be defined!'
                );
            }
            $table = isset($config['select']['table']) ? $config['select']['table'] : null;

            $instance = new $class($config['select']['column'], $table);
        } else {
            $instance = new $class();
        }

        foreach ($config as $key => $value) {
            $method = 'set'.ucfirst($key);
            if (method_exists($instance, $method)) {
                if (in_array($key, $this->specialMethods)) {
                    if (! is_array($value)) {
                        $value = [
                            $value,
                        ];
                    }
                    call_user_func_array([
                        $instance,
                        $method,
                    ], $value);
                } else {
                    call_user_func([
                        $instance,
                        $method,
                    ], $value);
                }
            }
        }

        return $instance;
    }
private function createColumn(array $config)
    {
        $colType = isset($config['colType']) ? $config['colType'] : 'Select';
        if (class_exists($colType, true)) {
            $class = $colType;
        } elseif (class_exists('ZfcDatagrid\\Column\\'.$colType, true)) {
            $class = 'ZfcDatagrid\\Column\\'.$colType;
        } else {
            throw new \InvalidArgumentException(sprintf('Column type: "%s" not found!', $colType));
        }

        if ('ZfcDatagrid\\Column\\Select' == $class) {
            if (! isset($config['select']['column'])) {
                throw new \InvalidArgumentException(
                    'For "ZfcDatagrid\Column\Select" the option select[column] must be defined!'
                );
            }
            $table = isset($config['select']['table']) ? $config['select']['table'] : null;

            $instance = new $class($config['select']['column'], $table);
        } else {
            $instance = new $class();
        }

        foreach ($config as $key => $value) {
            $method = 'set'.ucfirst($key);
            if (method_exists($instance, $method)) {
                if (in_array($key, $this->specialMethods)) {
                    if (! is_array($value)) {
                        $value = [
                            $value,
                        ];
                    }
                    call_user_func_array([
                        $instance,
                        $method,
                    ], $value);
                } else {
                    call_user_func([
                        $instance,
                        $method,
                    ], $value);
                }
            }
        }

        return $instance;
    }
private function createColumn ( array $ config ) { $ colType = isset ( $ config [ 'colType' ] ) ? $ config [ 'colType' ] : 'Select' ; if ( class_exists ( $ colType , true ) ) { $ class = $ colType ; } elseif ( class_exists ( 'ZfcDatagrid\\Column\\' . $ colType , true ) ) { $ class = 'ZfcDatagrid\\Column\\' . $ colType ; } else { throw new \ InvalidArgumentException ( sprintf ( 'Column type: "%s" not found!' , $ colType ) ) ; } if ( 'ZfcDatagrid\\Column\\Select' == $ class ) { if ( ! isset ( $ config [ 'select' ] [ 'column' ] ) ) { throw new \ InvalidArgumentException ( 'For "ZfcDatagrid\Column\Select" the option select[column] must be defined!' ) ; } $ table = isset ( $ config [ 'select' ] [ 'table' ] ) ? $ config [ 'select' ] [ 'table' ] : null ; $ instance = new $ class ( $ config [ 'select' ] [ 'column' ] , $ table ) ; } else { $ instance = new $ class ( ) ; } foreach ( $ config as $ key => $ value ) { $ method = 'set' . ucfirst ( $ key ) ; if ( method_exists ( $ instance , $ method ) ) { if ( in_array ( $ key , $ this -> specialMethods ) ) { if ( ! is_array ( $ value ) ) { $ value = [ $ value , ] ; } call_user_func_array ( [ $ instance , $ method , ] , $ value ) ; } else { call_user_func ( [ $ instance , $ method , ] , $ value ) ; } } } return $ instance ; }
Create a column from array instanceof.

@param array $config

@return Column\AbstractColumn
Create a column from array instanceof .