You are viewing documentation for an outdated version. It is no longer supported!

Export

The Dto abstraction supports two main data export methods; to array and JSON.

Array

Each DTO can be exported to an array.

$properties = $person->toArray();
var_dump($properties);  

The above example will output the following:

array(2) {
  ["name"]=> string(5) "Timmy"
  ["age"]=> int(19)
}