vivait / inspector-bundle
A bundle that performs actions based on events, providing they pass the specified conditions
Requires
- php: >=5.3
- psr/log: ~1.0
- vivait/common: ~2.0
- vivait/voter: dev-master
Requires (Dev)
- behat/behat: ~2.5
- behat/mink: *
- behat/mink-extension: *
- behat/mink-goutte-driver: *
- behat/symfony2-extension: *
- hautelook/alice-bundle: *
- phpspec/phpspec: dev-master
- phpunit/phpunit: 3.7.*
- vivait/behat-alice-loader: dev-master
- vivait/scrutinizer-formatter: dev-master
- webfactory/exceptions-bundle: @stable
This package is not auto-updated.
Last update: 2020-01-20 04:01:28 UTC
README
Registering a new condition entity
To register a new condition, the condition must extend Vivait\InspectorBundle\Entity\Condition
.
getFormType
The Condition
class will require that the getFormType
method is declared. This should be a simple method providing either the name of
the form or an instance of the form type for that entity.
loadService
It will also require that the loadService
method is declared. The bundle will provide this method with the service
container and this method will be responsible for loading and returning the service that will perform the condition.
For simple conditions that implement the ConditionInterface
, the loadService
method can return $this
(although this is not recommend as it violates the SRP.
For more complicated logic, or logic that requires external services, it is necessary to extra this functionality in to a separate class.