[11/06/2024] Les premières modifs + installation de quelques modules indispensables
This commit is contained in:
24
domokits/local/modules/OpenApi/Constraint/NotNull.php
Normal file
24
domokits/local/modules/OpenApi/Constraint/NotNull.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace OpenApi\Constraint;
|
||||
|
||||
use OpenApi\OpenApi;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
/**
|
||||
* @Annotation
|
||||
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
|
||||
*/
|
||||
class NotNull extends \Symfony\Component\Validator\Constraints\NotNull
|
||||
{
|
||||
public function __construct($options = null)
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->message = Translator::getInstance()->trans('This value should not be null', [], OpenApi::DOMAIN_NAME);
|
||||
}
|
||||
|
||||
public function validatedBy()
|
||||
{
|
||||
return get_parent_class().'Validator';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user