|
%!s(int64=5) %!d(string=hai) anos | |
---|---|---|
.gitlab | %!s(int64=6) %!d(string=hai) anos | |
Command | %!s(int64=7) %!d(string=hai) anos | |
Entity | %!s(int64=7) %!d(string=hai) anos | |
EventListener | %!s(int64=6) %!d(string=hai) anos | |
Resources | %!s(int64=6) %!d(string=hai) anos | |
Validator | %!s(int64=8) %!d(string=hai) anos | |
keys | %!s(int64=7) %!d(string=hai) anos | |
.drone.yml | %!s(int64=7) %!d(string=hai) anos | |
.gitlab-ci.yml | %!s(int64=5) %!d(string=hai) anos | |
ExtraDataBundle.php | %!s(int64=8) %!d(string=hai) anos | |
README.md | %!s(int64=8) %!d(string=hai) anos | |
composer.json | %!s(int64=7) %!d(string=hai) anos | |
cosa.txt | %!s(int64=6) %!d(string=hai) anos |
composer.json:
"repositories": [
{
"type": "vcs",
"url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/ExtraDataBundle.git"
}
],
"require": {
"ik/extra-data-bundle": "dev-master"
},
app/AppKernel.php:
public function registerBundles()
{
$bundles = [
new ExtraBundle\ExtraBundle(),
];
.
.
}
app/config/config.yml:
imports:
- { resource: "@ExtraBundle/Resources/config/services.yml" }
use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
/**
* @ORM\Entity
*/
class ONU
{
use ExtraDataTrait;
Luego ejecutar
$ bin/console doctrine:schema:update --force
use Symfony\Component\Validator\Constraints as Assert;
...
/**
* @var string $extraData
*
* @ORM\Column(type="text", nullable=true)
*
* @Assert\Callback(
* callback={"ExtraDataBundle\Validator\JSONValidator", "validate"},
* payload={"field"="extraData"}
* )
*/
private $extraData;
La option payload={"field"="extraData"}, es requerida, es el nombre del campo en el cual se quiere agregar el mensaje de error de validación.