sensorario / dto
There is no license information available for the latest version (2.0.1) of this package.
2.0.1
2017-06-12 07:12 UTC
Requires (Dev)
- phpunit/phpunit: ^6.2
README
Given a Dto like this:
class Person extends Dto
{
public $name;
public $surname;
}
available property names
Person::getPropertyNames(); // [ 'name', 'surname', ];
properties accessibility
$dto = Person::createFromArray([ 'name' => 'Simone', ]);
$dto->get('name'); // 'Simone'
properties as array
$dto = Person::createFromArray([
'name' => 'Simone',
'surname' => 'Gentili',
]);
$dto->asArray(); // [ 'name' => 'Simone', 'surname' => 'Gentili', ];