nepada/birth-number-doctrine
最新稳定版本:v1.3.2
Composer 安装命令:
composer require nepada/birth-number-doctrine
包简介
Czech birth number type for Doctrine.
README 文档
README
Installation
Via Composer:
$ composer require nepada/birth-number-doctrine
Register the type in your bootstrap:
\Doctrine\DBAL\Types\Type::addType( \Nepada\BirthNumberDoctrine\BirthNumberType::NAME, \Nepada\BirthNumberDoctrine\BirthNumberType::class );
In Nette with nettrine/dbal integration, you can register the types in your configuration:
dbal: connection: types: Nepada\BirthNumber\BirthNumber: Nepada\BirthNumberDoctrine\BirthNumberType
Usage
BirthNumberType maps database value to Birth number value object (see nepada/birth-number for further details) and back. The Birth number is stored as fixed string without the slash (e.g. 0001010009).
Example usage in the entity:
use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Nepada\BirthNumber\BirthNumber; #[Entity] class Person { #[Column(type: BirthNumber::class, nullable: false)] private BirthNumber $birthNumber; public function getBirthNumber(): BirthNumber { return $this->birthNumber; } }
Example usage in query builder:
$result = $repository->createQueryBuilder('foo') ->select('foo') ->where('foo.birthNumber = :birthNumber') // the parameter value is automatically normalized to '0001010009' ->setParameter('birthNumber', '000101 / 0009', BirthNumberType::NAME) ->getQuery() ->getResult();
统计信息
- 总下载量: 2.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-05-01