2017 © Pedro Peláez
 

library pretty-types

Doctrine Type storing pretty printed JSON into database

image

mapado/pretty-types

Doctrine Type storing pretty printed JSON into database

  • Thursday, February 22, 2018
  • by jdeniau
  • Repository
  • 3 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

Mapado pretty-types

Installation

composer require  mapado/pretty-types

JSON pretty

Based on Doctrine DBAL types., (*1)

Will store pretty printed JSON into database., (*2)

Configuration

In your config file, (*3)

# Doctrine Configuration
doctrine:
  dbal:
    types:
      json_pretty: Mapado\PrettyTypes\JsonPrettyType

Usage

In your entities, (*4)

/**
 * ...
 *
 * @ORM\Column(name="column_name", type="json_pretty")
 */

UTCDateTime

If you want to store datetime in UTC in your database., (*5)

Copied version from Working with DateTime Instances., (*6)

All credits goes to the doctrine team !, (*7)

Configuration

In your config file, (*8)

# Doctrine Configuration
doctrine:
  dbal:
    types:
      datetime: Mapado\PrettyTypes\UTCDateTimeType
      datetimetz: Mapado\PrettyTypes\UTCDateTimeType

Be aware that this will override all datetimes configured with doctrine., (*9)

If you do not want to override everything and use a custom types instead:, (*10)

# Doctrine Configuration
doctrine:
  dbal:
    types:
      utcdatetime: Mapado\PrettyTypes\UTCDateTimeType

Usage

In your entities, (*11)

/**
 * ...
 *
 * @ORM\Column(name="column_name", type="datetime")
 */

You should store the timezone next to the datetime too. Read the doctrine documentation for more informations., (*12)

If you configured a custom type, use this instead:, (*13)

/**
 * @ORM\Column(name="column_name", type="utcdatetime")
 */

License

This project is licensed under the MIT license., (*14)

The Versions

22/02 2018

dev-master

9999999-dev

Doctrine Type storing pretty printed JSON into database

  Sources   Download

MIT

The Requires

 

by Thomas di Luccio

json doctrine pretty

22/02 2018

v0.0.2

0.0.2.0

Doctrine Type storing pretty printed JSON into database

  Sources   Download

MIT

The Requires

 

by Thomas di Luccio

json doctrine pretty

20/02 2018

dev-tdl-feat-initial-setup

dev-tdl-feat-initial-setup

Doctrine Type storing pretty printed JSON into database

  Sources   Download

MIT

The Requires

 

by Thomas di Luccio

json doctrine pretty