maileryio/cycle-mapper

dev-master / 1.0.x-dev 2021-08-22 21:58 UTC

This package is auto-updated.

Last update: 2021-08-22 21:59:22 UTC


README

Mapper for Cycle ORM

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality Scrutinizer Code Coverage

Mapper for Cycle ORM

Installation

The preferred way to install this library is through composer.

Either run

php composer.phar require "maileryio/cycle-mapper"

or add

"maileryio/cycle-mapper": "*"

to the require section of your composer.json.

Usage

/**
 * @Cycle\Annotated\Annotation\Table(
 *      columns = {
 *          "created_at": @Cycle\Annotated\Annotation\Column(type = "datetime"),
 *          "updated_at": @Cycle\Annotated\Annotation\Column(type = "datetime")
 *      }
 * )
 */
class SubscriberMapper extends ChainedMapper
{
    /**
     * {@inheritdoc}
     */
    protected function getChainItemList(): ChainItemList
    {
        return new ChainItemList([
            (new Timestamped())
                ->withCreatedAt('created_at')
                ->withUpdatedAt('updated_at'),
        ]);
    }
}

License

This project is released under the terms of the BSD-3-Clause license. Read more here.

Copyright © 2020, Mailery (https://mailery.io)