PHP code example of vasildakov / postcode-doctrine

1. Go to this page and download the library: Download vasildakov/postcode-doctrine 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/ */

    

vasildakov / postcode-doctrine example snippets

 php
\Doctrine\DBAL\Types\Type::addType('postcode', 'VasilDakov\Postcode\Doctrine\PostcodeType');
 php
/**
 * @Entity
 * @Table(name="address")
 */
class Address
{
    /**
     * @var \VasilDakov\Postcode\Postcode
     * @Column(type="postcode")
     */
    protected $postcode;

    public function getPostcode()
    {
        return $this->postcode;
    }
}