/** * @return array */ public function toArray() { $data = $this->record->getData(); foreach ($data as &$value) { if ($value instanceof HasToArray) { $value = $value->toArray(); } } return $data; }
/** * @test */ public function testUnsetProperty() { $storage = new Record(['nickname' => 'foo']); $storage->unsetProperty('nickname'); $this->assertEquals([], $storage->getData()); }