private function toArray()
    {
        $data = [];

        $reflection = new ReflectionClass($this);

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);
            $data[$property->getName()] = $property->getValue($this);
        }

        return $data;
    }
private function toArray()
    {
        $data = [];

        $reflection = new ReflectionClass($this);

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);
            $data[$property->getName()] = $property->getValue($this);
        }

        return $data;
    }
private function toArray ( ) { $ data = [ ] ; $ reflection = new ReflectionClass ( $ this ) ; foreach ( $ reflection -> getProperties ( ) as $ property ) { $ property -> setAccessible ( true ) ; $ data [ $ property -> getName ( ) ] = $ property -> getValue ( $ this ) ; } return $ data ; }
Convert the ViewModel object to an array

@return array
Convert the ViewModel object to an array