2017 © Pedro Peláez
 

library dto

A PHP DTO Component to make simple transfer data between application layers

image

dunice/dto

A PHP DTO Component to make simple transfer data between application layers

  • Tuesday, February 3, 2015
  • by dunice
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

DTO Component

DTO (Data Transfer Object) is a pattern used to encapsulate data information and transfer them between application layers., (*1)

This component allows to create and access DTOs based on arrays and objects., (*2)

Example

<?php
$params = array(
    'idPerson' => 1,
    'idAddress' => array(
        'idAddress' => 1,
        'txAddress' => '5th Avenue, 1250'
    )
);
$dto = new \Dto\Mapping\Base($params);

$dto->getIdPerson(); // 1
$dto->getIdAddress(); // DtoObject
$dto->getIdAddress()->getIdAddress(); // 1
$dto->getIdAddress()->getTxAddress(); // 5th Avenue, 1250

Example

<?php
$params = array(
  'idPerson' => 1
);
$dto = new \Dto\Mapping\Base($params);

$dto->getIdPerson(); // 1

// Now set an address info
$dto->setIdAddress(array(
    'idAddress' => 1,
    'txAddress' => '5th Avenue, 1250'
));

$dto->getIdAddress(); // DtoObject
$dto->getIdAddress()->getIdAddress(); // 1
$dto->getIdAddress()->getTxAddress(); // 5th Avenue, 1250

The Versions

03/02 2015

dev-master

9999999-dev http://dunice.com.br

A PHP DTO Component to make simple transfer data between application layers

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

dto

03/02 2015

v0.1

0.1.0.0 http://dunice.com.br

A PHP DTO Component to make simple transfer data between application layers

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

dto