Download the PHP package sonofwinter/binding-bundle without Composer
On this page you can find all versions of the php package sonofwinter/binding-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sonofwinter/binding-bundle
More information about sonofwinter/binding-bundle
Files in sonofwinter/binding-bundle
Package binding-bundle
Short Description This Bundle provides a binding from array to Entity with Symfony
License MIT
Informations about the package binding-bundle
Installation
Open a command console, enter your project directory and execute:
Usage
Define binding properties in your entity
For v0.3.0 and above
For v0.2.0 and below
You must defined the key|name property. It's the array value's key.
The setter property is used if you want to use another setter.
The type property is used if you want to make a type check. A BinderTypeException is throws if the type doens't correspond.
Use Binder service for bind an array to entity
New in v0.4 inclusion and exclusion
$include is a key array required in $params, if one or more keys are missing, an exception is thrown
$exclude is a key array ignored in $params. No exception was thrown is a key is present.
new in v0.5 min and max
The min and max value check if the value is in range defined by the two properties.
If not, a specific exception was thrown
Works with number (int/float), string (length) and array (count)
new in v0.6 child binder
A child entity can be binding when the type is set with the entity namespace.
The getter is use to get the sub entity. If the sub entity is null, it try to create him (without parameter), if fail the binder skip sub entity. So if the constructor need parameters, the sub entity must be defined before the binder action.
Exemple of data :
new in v0.7 Nullable
The nullable property define if a null value can be set to entity's property. The property default value is false.
V0.7.1 update
Update Symfony minimum version 4.0 -> 4.1
V0.8.0 update
Update Symfony minimum version 4.1 -> 4.3 || 5.0
v0.9.0 update
Adds attributes and increases minimum versions :
- Symfony minimum version 5.0
- PHP minimum version 8.0
So now, you can use attribute instead of annotation.
You have to add this configuration to use it :
You can also override Binder attribute with this configuration :
All versions of binding-bundle with dependencies
symfony/framework-bundle Version ^6.0
symfony/orm-pack Version *
symfony/dependency-injection Version ^6.0
symfony/yaml Version ^6.0
doctrine/annotations Version ^2.0