Skip to content

scott-davidjones/jms-serializer-carbon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jms-serializer-carbon

Carbon Serializer for the JMS Serializer library

Installation

To instal and use the package please install as per the JMS documentation:

$builder
    ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
        $registry->registerSubscribingHandler(new \AutumnDev\JMS\CarbonHandler());
    })
;

Symfony2

You will need to register a new service in order to utilise the Carbon serilisation:

carbon_handler:
        class: AutumnDev\JMS\CarbonHandler
        tags:
            - { name: jms_serializer.subscribing_handler }

Usage

In order to use the serialisation you must tag your entities thusly:

    /**
    * @Type("Carbon")
    */
    public $date;