Download the PHP package intracto/smartcode-bundle without Composer
On this page you can find all versions of the php package intracto/smartcode-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intracto/smartcode-bundle
More information about intracto/smartcode-bundle
Files in intracto/smartcode-bundle
Package smartcode-bundle
Short Description This bundle provides a way to generate software licenses with Symfony2
License MIT
Homepage https://github.com/intracto
Informations about the package smartcode-bundle
Needs maintainer
If you use this bundle, contact @tvlooy about ownership.
SmartCodeBundle
This bundle provides a way to generate software licenses for a given payload.
It has been inspired by the Promotion Bundle of Sylius.
How to install?
Install the bundle via composer
Enable the bundle
How to run tests?
How to get started?
Smart codes have to be bound to a payload this can be done by implementing the PayloadInterface.
Now you can get started with the generation. To generate Smart codes you can use the SmartCodeGenerator or create your own by implementing the SmartCodeGeneratorInterface.
This service will allow you to call the function:
As you can see this has 2 parameters, the first is your payload that you created in step 1 and the 2nd is a model containing all your options.
- Amount: The amount of smart codes you wish to generate for the given payload.
- UsageLimit: The amount of times a smart code can be used.
- ExpiresAt: The expiry date for a smart code.
- StartsAt: The date a smart code can start being used.
- Batch: A name or description you want to give the current generation.
The last thing you would probably want to do is to be able to use these smart codes you just generated. This is possible via the SmartCodeAction service, which you can also overwrite by implementing the SmartCodeActionInterface.
This class has 2 required functions:
To register or unregister a certain smart code you would need a subject that is going to be using this code. To make such a subject you can implement the SubjectInterface.
All versions of smartcode-bundle with dependencies
doctrine/orm Version ~2.4
symfony/framework-bundle Version ~4.3
symfony/validator Version ~4.3