addCustomStringFunction example

$this->setProxyNamespace($options['proxyNamespace']);

        $this->setRepositoryFactory($repositoryFactory);
        $this->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS);

        $this->setAttributeDir($options['attributeDir']);

        Type::overrideType('datetime', \Shopware\Components\Model\DBAL\Types\DateTimeStringType::class);
        Type::overrideType('date', \Shopware\Components\Model\DBAL\Types\DateStringType::class);
        Type::overrideType('array', \Shopware\Components\Model\DBAL\Types\AllowInvalidArrayType::class);

        $this->addCustomStringFunction('DATE_FORMAT', DateFormat::class);
        $this->addCustomStringFunction('IFNULL', IfNull::class);
        $this->addCustomStringFunction('IF', IfElse::class);
        $this->addCustomStringFunction('RegExp', Regexp::class);
        $this->addCustomStringFunction('Replace', Replace::class);
        $this->addCustomStringFunction('GroupConcat', GroupConcat::class);

        $this->release = $release;

        // Load custom namespace for doctrine cache provider, if provided         if (isset($options['cacheNamespace'])) {
            $this->cacheNamespace = $options['cacheNamespace'];
        }
Home | Imprint | This part of the site doesn't use cookies.