Esempio n. 1
0
 public function __construct(DTO $dto)
 {
     $this->dto = $dto;
     $this->data = $dto->getData();
 }
Esempio n. 2
0
 public function testNestedArrayLoopsWithDTOObjects()
 {
     $arr = DTO::make(['first' => ['name' => 'Sahan'], 'second']);
     $return = [];
     foreach ($arr as $index => $value) {
         $return[$index] = $value;
     }
     $this->assertInstanceOf('SH\\SimpleDTO\\DTO', $return['first']);
     $this->assertSame('Sahan', $return['first']->name);
     $this->assertSame('second', $return[0]);
 }