承接 nepada/email-address-doctrine 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nepada/email-address-doctrine

最新稳定版本:v1.8.2

Composer 安装命令:

composer require nepada/email-address-doctrine

包简介

Email address type for Doctrine.

README 文档

README

Build Status Coverage Status Downloads this Month Latest stable

Installation

Via Composer:

$ composer require nepada/email-address-doctrine

Register the types in your bootstrap:

\Doctrine\DBAL\Types\Type::addType( \Nepada\EmailAddress\RfcEmailAddress::class, \Nepada\EmailAddressDoctrine\RfcEmailAddressType::class ); \Doctrine\DBAL\Types\Type::addType( \Nepada\EmailAddress\CaseInsensitiveEmailAddress::class, \Nepada\EmailAddressDoctrine\CaseInsensitiveEmailAddressType::class );

In Nette with nettrine/dbal integration, you can register the types in your configuration:

dbal: connection: types: Nepada\EmailAddress\RfcEmailAddress: Nepada\EmailAddressDoctrine\RfcEmailAddressType Nepada\EmailAddress\CaseInsensitiveEmailAddress: Nepada\EmailAddressDoctrine\CaseInsensitiveEmailAddressType

Usage

This package provides two Doctrine types:

  1. RfcEmailAddressType for storing emails represented by RfcEmailAddress.
  2. CaseInsensitiveEmailAddressType for storing emails represented by CaseInsensitiveEmailAddress.

Both types normalize the domain part of the email address before storing it in database, but they differ in handling of the local part of the address. See nepada/email-address for further details.

Example usage in the entity:

use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Nepada\EmailAddress\CaseInsensitiveEmailAddress; #[Entity] class Contact { #[Column(type: CaseInsensitiveEmailAddress::class, nullable: false)] private CaseInsensitiveEmailAddress $email; public function getEmailAddress(): CaseInsensitiveEmailAddress { return $this->emailAddress; } }

Example usage in query builder:

$result = $repository->createQueryBuilder('foo') ->select('foo') ->where('foo.email = :emailAddress') // the parameter value is automatically normalized to example@example.com ->setParameter('emailAddress', 'Example@Example.com', CaseInsensitiveEmailAddress::class) ->getQuery() ->getResult();

统计信息

  • 总下载量: 9.43k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固