cancio-labs/cpf-doctrine-type

A custom mapping type for CPF value object.

1.0.1 2024-07-24 17:01 UTC

This package is not auto-updated.

Last update: 2025-05-01 18:46:51 UTC


README

This tiny package contains a custom mapping type for CPF value object.

Requirements

  • PHP >= 7.4
  • Doctrine DBAL >= 3.0

Installation

composer require cancio-labs/cpf-doctrine-type

How to use it

First, copy the class name of the Cpf mapping type:

'CancioLabs\Doctrine\Type\Cpf\CpfType'

Then, register it in your application by following one of these guides:

Finally, use the 'cpf' mapping type inside your entity:

use CancioLabs\ValueObject\Cpf\Cpf;

#[ORM\Column(type: 'cpf')]
private ?Cpf $cpf = null;