PHP code example of ali-eltaweel / dto

1. Go to this page and download the library: Download ali-eltaweel/dto 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/ */

    

ali-eltaweel / dto example snippets


use DTO\DataTransferObject;

class InputDirectory extends DataTransferObject {

  public final function __construct(string $path, float $maxDepth = 32, bool $followSymlinks = true) {

    parent::__construct(func_get_args());
  }
}

$inputDirectory = InputDirectory::fromArray([ 'path' => '/var/www/html' ]);

use DTO\DataTransferMap;

class LookupTable extends DataTransferMap {
}

use DTO\DataTransferMap;

class LookupTable extends DataTransferMap {

  function __v(string $field) {}
}

use DTO\DataTransferCollection;

class InputDirectories extends DataTransferCollection {

  function __v(InputDirectory $field) {}
}