src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/Contao2BackendViewDefinitionBuilder.php
private function getOrCreateDefinition()
    {
        if ($this->container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) {
            $view = $this->container->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
            if (!$view instanceof Contao2BackendViewDefinitionInterface) {
                throw new DcGeneralInvalidArgumentException(
                    'Configured BackendViewDefinition does not implement Contao2BackendViewDefinitionInterface.'
                );
            }
            return $view;
        }
        $this->container->setDefinition(
            Contao2BackendViewDefinitionInterface::NAME,
            $view = new Contao2BackendViewDefinition()
        );

        return $view;
    }
private function getOrCreateDefinition()
    {
        if ($this->container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) {
            $view = $this->container->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
            if (!$view instanceof Contao2BackendViewDefinitionInterface) {
                throw new DcGeneralInvalidArgumentException(
                    'Configured BackendViewDefinition does not implement Contao2BackendViewDefinitionInterface.'
                );
            }
            return $view;
        }
        $this->container->setDefinition(
            Contao2BackendViewDefinitionInterface::NAME,
            $view = new Contao2BackendViewDefinition()
        );

        return $view;
    }
private function getOrCreateDefinition ( ) { if ( $ this -> container -> hasDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ) { $ view = $ this -> container -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; if ( ! $ view instanceof Contao2BackendViewDefinitionInterface ) { throw new DcGeneralInvalidArgumentException ( 'Configured BackendViewDefinition does not implement Contao2BackendViewDefinitionInterface.' ) ; } return $ view ; } $ this -> container -> setDefinition ( Contao2BackendViewDefinitionInterface :: NAME , $ view = new Contao2BackendViewDefinition ( ) ) ; return $ view ; }
Get or create the definition.

@return Contao2BackendViewDefinitionInterface

@throws DcGeneralInvalidArgumentException When the contained view definition is of invalid type.
Get or create the definition .