Doctrine Support

Doctrine Support#

Packagist GitLab GitHub Bitbucket Gitea

Doctrine support is split into a separate package.

Installation#

composer require 'arokettu/date-doctrine'

Available Types#

  • DateType. UUID stored in a native DATE column.

Usage#

Register types:

<?php

use Arokettu\Uuid\Doctrine\DateType;
use Doctrine\DBAL\Types\Type;

// registers types directly
Type::addType(DateType::NAME, DateType::class);

Note

See your framework documentation for proper configuration of custom Doctrine types.

Apply type to a model:

<?php

use Arokettu\Date\Date;
use Doctrine\ORM\Mapping\{Column,Table};

#[Entity, Table(name: 'date_object')]
class DateObject
{
    #[Column(type: DateType::NAME)]
    public Date $date;
}