nepada/phone-number-doctrine 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nepada/phone-number-doctrine

最新稳定版本:v2.3.3

Composer 安装命令:

composer require nepada/phone-number-doctrine

包简介

Phone number type for Doctrine.

README 文档

README

Build Status Coverage Status Downloads this Month Latest stable

Installation

Via Composer:

$ composer require nepada/phone-number-doctrine

Register the type in your bootstrap:

\Doctrine\DBAL\Types\Type::addType( \Brick\PhoneNumber\PhoneNumber::class, \Nepada\PhoneNumberDoctrine\PhoneNumberType::class );

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

dbal: connection: types: Brick\PhoneNumber\PhoneNumber: Nepada\PhoneNumberDoctrine\PhoneNumberType

Usage

PhoneNumberType maps database value to phone number value object (see brick/phonenumber for further details) and back. The phone number is stored using E164 format, i.e. a '+' sign followed by a series of digits comprising the country code and national number.

Example usage in the entity:

use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Brick\PhoneNumber\PhoneNumber; #[Entity] class Contact { #[Column(type: PhoneNumber::class, nullable: false)] private PhoneNumber $phoneNumber; public function getPhoneNumber(): PhoneNumber { return $this->phoneNumber; } }

Example usage in query builder:

$result = $repository->createQueryBuilder('foo') ->select('foo') ->where('foo.phoneNumber = :phoneNumber') // the parameter value is automatically normalized to +420123456789 ->setParameter('phoneNumber', '+420 123 456 789', \Brick\PhoneNumber\PhoneNumber::class) ->getQuery() ->getResult();

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固