PHP code example of upscale / doctrine-value-object-bundle

1. Go to this page and download the library: Download upscale/doctrine-value-object-bundle 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/ */

    

upscale / doctrine-value-object-bundle example snippets


use Upscale\DoctrineValueObjectBundle\Attribute\ValueObject;
use Yokai\DoctrineValueObject\StringValueObject;

#[ValueObject]
class PhoneNumber implements StringValueObject {...}

#[Entity]
class Person
{
    #[Column(type: 'phone_number')]
    private PhoneNumber $phone;
    
    // ...
}

#[ValueObject(type: PhoneNumber::class)]
class PhoneNumber implements StringValueObject {...}

#[Entity]
class Person
{
    #[Column(type: PhoneNumber::class)]
    private PhoneNumber $phone;
    
    // ...
}