nordic/email-address-doctrine
Composer 安装命令:
composer require nordic/email-address-doctrine
包简介
Doctrine email address type.
README 文档
README
The nordic/email-address-doctrine package provides the ability to use nordic/email-address as a Doctrine field type.
Install
Via Composer
$ composer require nordic/email-address-doctrine
Configuration
To configure Doctrine to use nordic/email-address as a field type, you'll need to set up the following in your bootstrap:
<?php use Doctrine\DBAL\Types\Type; use Nordic\EmailAddress\Doctrine\EmailAddressType; Type::addType(EmailAddressType::EMAIL_ADDRESS, EmailAddressType::CLASS); // or Type::addType('email_address', 'Nordic\EmailAddress\Doctrine\EmailAddressType');
Usage
Now you can annotate properties in your entities:
use Doctrine\ORM\Mapping as ORM; use Nordic\EmailAddress\EmailAddressInterface; /** * @ORM\Entity * @ORM\Table(name="contacts") */ class Contact { /** * @ORM\Column(type="email_address") * @var EmailAddressInterface */ private $emailAddress; public function getEmailAddress(): EmailAddressInterface { return $this->emailAddress; } }
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-02