https://github.com/canciolabs/cpf-doctrine-type
This tiny package contains a custom mapping type for CPF value object.
https://github.com/canciolabs/cpf-doctrine-type
cpf doctrine-dbal php value-object
Last synced: about 1 month ago
JSON representation
This tiny package contains a custom mapping type for CPF value object.
- Host: GitHub
- URL: https://github.com/canciolabs/cpf-doctrine-type
- Owner: canciolabs
- License: gpl-3.0
- Created: 2024-07-24T16:26:53.000Z (9 months ago)
- Default Branch: develop
- Last Pushed: 2024-07-24T17:01:38.000Z (9 months ago)
- Last Synced: 2025-02-01T02:51:13.428Z (3 months ago)
- Topics: cpf, doctrine-dbal, php, value-object
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPF Doctrine Type
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:
- Symfony Framework: https://symfony.com/doc/current/doctrine/dbal.html
- Doctrine: https://www.doctrine-project.org/projects/doctrine-orm/en/3.2/cookbook/custom-mapping-types.htmlFinally, use the 'cpf' mapping type inside your entity:
use CancioLabs\ValueObject\Cpf\Cpf;
#[ORM\Column(type: 'cpf')]
private ?Cpf $cpf = null;