An open API service indexing awesome lists of open source software.

https://github.com/laxcorp/innkppbundle


https://github.com/laxcorp/innkppbundle

php symfony-bundle symfony-validator

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

INN + KPP validation for ORM Entity
=======================================================

Install
-------
composer require laxcorp/inn-kpp-bundle

Add in app/AppKernel.php
------------------------
```php
$bundles = [
new LaxCorp\InnKppBundle\InnKppBundle()
]
```

Use in field (Inn only)
-------------

```php
use LaxCorp\InnKppBundle\Validator\Constraints\Inn as AssertInn;

....

/**
* @var string|null
*
* @ORM\Column(name="inn", type="string", length=255, nullable=true)
* @AssertInn
*/
private $inn;
```

Use in Entity
-------------
```
use LaxCorp\InnKppBundle\Validator\Constraints\InnKppEntity;
```

```php
/**
*
* @ORM\Entity
*
* @InnKppEntity(
* fieldInn="inn",
* fieldKpp="kpp",
* ignoreNull=true
* )
*/
class ...
```

Example AppBundle/Entity/Company.php
---------------------------------
```php
inn = $inn;

return $this;
}

/**
* Get inn
*
* @return string
*/
public function getInn()
{
return $this->inn;
}

/**
* Set kpp
*
* @param string $kpp
*
* @return Company
*/
public function setKpp($kpp)
{
$this->kpp = $kpp;

return $this;
}

/**
* Get kpp
*
* @return string
*/
public function getKpp()
{
return $this->kpp;
}

}
````