This library provides Zend\Validator support for the polderknowledge/entityservice library
Via Composer
$ composer require polderknowledge/entityservice-zend-validator
After you have configured the EntityService you can use the validators without further config:
namespace MyApp\InputFilter;
use PolderKnowledge\EntityService\Validator\EntityExists;
use Zend\InputFilter\InputFilter;
use PonyApp\Entity\Pony;
class PonyEditInputFilter extends InputFilter
{
/**
* Initializes the input filter.
*/
public function init()
{
$this->add([
'name' => 'ponyId',
'validators' => [
[
'name' => EntityExists::class, // or EntityNotExists
'options' => [
'entity' => Pony::class,
'field' => 'name', // defaults to id
],
],
],
]);
}
}
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please report them via HackerOne instead of using the issue tracker or e-mail.
We have an IRC channel where you can find us every now and then. We're on the Freenode network in the channel #polderknowledge.
Please see LICENSE.md for the license of this application.