https://github.com/laxcorp/innkppbundle
https://github.com/laxcorp/innkppbundle
php symfony-bundle symfony-validator
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/laxcorp/innkppbundle
- Owner: LaxCorp
- Created: 2017-12-21T05:08:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T03:16:37.000Z (almost 6 years ago)
- Last Synced: 2025-02-04T16:26:18.773Z (5 months ago)
- Topics: php, symfony-bundle, symfony-validator
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
INN + KPP validation for ORM Entity
=======================================================Install
-------
composer require laxcorp/inn-kpp-bundleAdd 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;
}
}
````