PHP code example of jamielsharief / data-transfer-object
1. Go to this page and download the library: Download jamielsharief/data-transfer-object 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/ */
jamielsharief / data-transfer-object example snippets
use DataTransferObject\DataTransferObject;
class Employee extends DataTransferObject
{
public string $name;
public string $email;
public ?Employee $reportsTo;
public int $age;
public bool $active = true;
/**
* @var \App\DataTransferObject\Employee[] $subordinates
*/
public array $subordinates = [];
}
$employee = new Employee();
$employee->name = 'sarah';