public function createButton(GetOperationButtonEvent $event)
    {
        if ('createvariant' !== $event->getCommand()->getName()) {
            return;
        }
        /** @var Model $model */
        $model     = $event->getModel();
        $metamodel = $model->getItem()->getMetaModel();

        if (!$metamodel->hasVariants() || $model->getProperty('varbase') === '0') {
            $event->setHtml('');
        }
    }
public function createButton(GetOperationButtonEvent $event)
    {
        if ('createvariant' !== $event->getCommand()->getName()) {
            return;
        }
        /** @var Model $model */
        $model     = $event->getModel();
        $metamodel = $model->getItem()->getMetaModel();

        if (!$metamodel->hasVariants() || $model->getProperty('varbase') === '0') {
            $event->setHtml('');
        }
    }
public function createButton ( GetOperationButtonEvent $ event ) { if ( 'createvariant' !== $ event -> getCommand ( ) -> getName ( ) ) { return ; } /** @var Model $model */ $ model = $ event -> getModel ( ) ; $ metamodel = $ model -> getItem ( ) -> getMetaModel ( ) ; if ( ! $ metamodel -> hasVariants ( ) || $ model -> getProperty ( 'varbase' ) === '0' ) { $ event -> setHtml ( '' ) ; } }
Check if we have to add the "Create variant" button.

@param GetOperationButtonEvent $event The event.

@return void
Check if we have to add the Create variant button .