public static function from($componentOrField, bool $hidden = false) : IColumn
    {
        if ($componentOrField instanceof IColumnComponent) {

        } elseif ($componentOrField instanceof IField) {
            $componentOrField = ColumnComponent::forField($componentOrField);
        } elseif ($componentOrField instanceof FieldBuilderBase) {
            $componentOrField = ColumnComponent::forField($componentOrField->build());
        } else {
            throw TypeMismatchException::argument(
                    __METHOD__,
                    'field',
                    IColumnComponent::class . '|' . IField::class . '|' . FieldBuilderBase::class,
                    $componentOrField
            );
        }

        return self::name($componentOrField->getName())
            ->label($componentOrField->getLabel())
            ->hidden($hidden)
            ->components([$componentOrField]);
    }
public static function from($componentOrField, bool $hidden = false) : IColumn
    {
        if ($componentOrField instanceof IColumnComponent) {

        } elseif ($componentOrField instanceof IField) {
            $componentOrField = ColumnComponent::forField($componentOrField);
        } elseif ($componentOrField instanceof FieldBuilderBase) {
            $componentOrField = ColumnComponent::forField($componentOrField->build());
        } else {
            throw TypeMismatchException::argument(
                    __METHOD__,
                    'field',
                    IColumnComponent::class . '|' . IField::class . '|' . FieldBuilderBase::class,
                    $componentOrField
            );
        }

        return self::name($componentOrField->getName())
            ->label($componentOrField->getLabel())
            ->hidden($hidden)
            ->components([$componentOrField]);
    }
public static function from ( $ componentOrField , bool $ hidden = false ) : IColumn { if ( $ componentOrField instanceof IColumnComponent ) { } elseif ( $ componentOrField instanceof IField ) { $ componentOrField = ColumnComponent :: forField ( $ componentOrField ) ; } elseif ( $ componentOrField instanceof FieldBuilderBase ) { $ componentOrField = ColumnComponent :: forField ( $ componentOrField -> build ( ) ) ; } else { throw TypeMismatchException :: argument ( __METHOD__ , 'field' , IColumnComponent :: class . '|' . IField :: class . '|' . FieldBuilderBase :: class , $ componentOrField ) ; } return self :: name ( $ componentOrField -> getName ( ) ) -> label ( $ componentOrField -> getLabel ( ) ) -> hidden ( $ hidden ) -> components ( [ $ componentOrField ] ) ; }
Create a simple column for the supplied column component or form field.

@param IColumnComponent|FieldBuilderBase|IField $componentOrField
@param bool                                     $hidden

@return IColumn
@throws TypeMismatchException
Create a simple column for the supplied column component or form field .