承接 litipk/doctrine-mongodb-jiffy 相关项目开发

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

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

litipk/doctrine-mongodb-jiffy

最新稳定版本:1.0.0

Composer 安装命令:

composer require litipk/doctrine-mongodb-jiffy

包简介

Type adapter for Jiffy's Universal Timestamps on Doctrine MongoDB ODM

README 文档

README

Author Quality Score Software License Packagist Version Total Downloads

About the library

PHP does not offer any native class to implement timestamps with milliseconds or microseconds precision, the only "native" way to do it is working with the weird microtime function and/or the \MongoDate class.

This library provides a Doctrine ODM type to make possible using the PHP-Jiffy's UniversalTimestamp objects in our Doctrine ODM models. It's very useful if you need to deal with very precise timestamps but you don't want to couple your code with the \MongoDate class without giving up on type hinting.

As an extra bonus, this library provides future compatibility with the mongodb extension and its MongoDB\BSON\UTCDateTime class.

Installation

composer require litipk/doctrine-mongodb-jiffy

Usage

To use this type there are three steps:

  1. Install the library through Composer.
  2. Register the type in your application, if you are using Symfony, the Bundle constructor is a good place to do it.
    
    Type::registerType(
        'UniversalTimestamp',
        'Litipk\Jiffy\Doctrine\ODM\MongoDB\UniversalTimestampType'
    );
    
  3. Use the type in your models with the @UniversalTimestampField annotation.
    use Litipk\Jiffy\Doctrine\ODM\MongoDB\UniversalTimestampField;
    
    class OurDocument
    {
        /**
         * @UniversalTimestampField()
         * @var UniversalTimestamp
         */
        private $creationDate;
        
        // [...]
    }

统计信息

  • 总下载量: 813
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固