2017 © Pedro PelĂĄez
 

library doctrine-mongodb-jiffy

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

image

litipk/doctrine-mongodb-jiffy

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

  • Tuesday, June 7, 2016
  • by castarco
  • Repository
  • 1 Watchers
  • 1 Stars
  • 810 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Doctrine ODM MongoDB adapter for Jiffy Universal Timestamps

Author Quality Score Software License Packagist Version Total Downloads, (*1)

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., (*2)

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., (*3)

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

Installation

composer require litipk/doctrine-mongodb-jiffy

Usage

To use this type there are three steps:, (*5)

  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., (*6)


    Type::registerType( 'UniversalTimestamp', 'Litipk\Jiffy\Doctrine\ODM\MongoDB\UniversalTimestampType' );
  3. Use the type in your models with the @UniversalTimestampField annotation., (*7)

    use Litipk\Jiffy\Doctrine\ODM\MongoDB\UniversalTimestampField;
    
    class OurDocument
    {
        /**
         * @UniversalTimestampField()
         * @var UniversalTimestamp
         */
        private $creationDate;
    
        // [...]
    }
    

The Versions

07/06 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca

07/06 2016

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca

06/03 2016

0.2.1

0.2.1.0

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca

05/03 2016

0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca

08/11 2015

0.1.1

0.1.1.0

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca

08/11 2015

0.1.0

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Andrés Correa Casablanca