public function toArray(): array
    {
        $result = [];
        foreach (static::getInstanceProperties() as $key) {
            $result[$key] = $this->$key;
        }

        return $result;
    }
public function toArray(): array
    {
        $result = [];
        foreach (static::getInstanceProperties() as $key) {
            $result[$key] = $this->$key;
        }

        return $result;
    }
public function toArray ( ) : array { $ result = [ ] ; foreach ( static :: getInstanceProperties ( ) as $ key ) { $ result [ $ key ] = $ this -> $ key ; } return $ result ; }
Returns array representation of DTO properties.

@return mixed[]
Returns array representation of DTO properties .