1. Go to this page and download the library: Download zolex/vom 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/ */
use Zolex\VOM\Mapping as VOM;
#[VOM\Model]
class Person
{
#[VOM\Property]
public string $firstname;
#[VOM\Property('[surname]')]
public string $lastname;
#[VOM\Property(accessor: false)]
public Address $address;
#[VOM\Property(accessor: false)]
public Contact $contact;
}
#[VOM\Model]
class Address
{
#[VOM\Property]
public string $street;
#[VOM\Property('[zip]')]
public string $zipCode;
#[VOM\Property]
public string $city;
#[VOM\Property('[country_name]')]
public string $country;
}
#[VOM\Model]
class Contact
{
#[VOM\Property('[email_address]')]
public string $email;
#[VOM\Property]
public string $phone;
}