PHP code example of brazanation / document-doctrine-types

1. Go to this page and download the library: Download brazanation/document-doctrine-types library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brazanation / document-doctrine-types example snippets


// bootstrap.php

// ... other code
$connection = \Doctrine\DBAL\DriverManager::getConnection($conn, $config, new \Doctrine\Common\EventManager());

\Brazanation\Doctrine\TypeExtension::register($connection);

// ... more code

/**
 * @Entity @Table(name="persons")
 */
class Person
{
    /**
     * @Id
     * @Column(type="cpf")
     * @var \Brazanation\Documents\Cpf
     */
    private $cpf;

    public function __construct(\Brazanation\Documents\Cpf $cpf)
    {
        $this->cpf = $cpf;
    }

    public function getCpf()
    {
        return $this->cpf;
    }
}