Generator example


            );
        }

        if (\count($images)) {
            return $images[array_rand($images)]->getPathname();
        }

        /** @var string $text */
        $text = $context->getFaker()->words(1, true);

        $provider = new ImagesGeneratorProvider(new Generator());

        return $provider->imageGenerator(
            null,
            $context->getFaker()->numberBetween(600, 800),
            $context->getFaker()->numberBetween(400, 600),
            'jpg',
            true,
            $text,
            '#d8dde6',
            '#333333'
        );
    }

    public function enableDebugMode()
    {
        $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> */
Home | Imprint | This part of the site doesn't use cookies.