getAttributeDir example


    public function factory(Configuration $config$modelPath)
    {
        $annotationDriver = new AnnotationDriver(
            $config->getAnnotationsReader(),
            [
                $modelPath,
                $config->getAttributeDir(),
            ]
        );

        $config->setMetadataDriverImpl($annotationDriver);

        return $annotationDriver;
    }
}

        $this->debugMode = true;
    }

    /** * @return Generator */
    public function createModelGenerator()
    {
        return new Generator(
            $this->getConnection()->getSchemaManager(),
            $this->getConfiguration()->getAttributeDir(),
            Shopware()->AppPath('Models')
        );
    }

    /** * Serialize an entity to an array * * @author Boris GuĂ©ry <guery.b@gmail.com> * @license http://sam.zoy.org/wtfpl/COPYING * * @see http://borisguery.github.com/bgylibrary * @see https://gist.github.com/1034079#file_serializable_entity.php * * @param ModelEntity|null $entity * * @return array<string, mixed> */
public function factory(
        EventManager $eventManager,
        Configuration $config,
        Enlight_Loader $loader,
        Connection $connection,
        // Annotation driver is not really used here but has to be loaded first         AnnotationDriver $modelAnnotation,
        ?QueryOperatorValidator $operatorValidator = null
    ) {
        $loader->registerNamespace(
            'Shopware\Models\Attribute',
            $config->getAttributeDir()
        );

        $connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
        $connection->getDatabasePlatform()->registerDoctrineTypeMapping('bit', 'boolean');

        $entityManager = ModelManager::createInstance(
            $connection,
            $config,
            $eventManager,
            $operatorValidator
        );

        
Home | Imprint | This part of the site doesn't use cookies.