public function toArray()
    {
        $out = [];

        foreach ($this->setFields as $key) {
            $property = $this->{$key};

            if ($property instanceof DateTime) {
                $out[$key] = $property->format(DateTime::ISO8601);
            } else {
                $out[$key] = $property;
            }
        }

        return $out;
    }
public function toArray()
    {
        $out = [];

        foreach ($this->setFields as $key) {
            $property = $this->{$key};

            if ($property instanceof DateTime) {
                $out[$key] = $property->format(DateTime::ISO8601);
            } else {
                $out[$key] = $property;
            }
        }

        return $out;
    }
public function toArray ( ) { $ out = [ ] ; foreach ( $ this -> setFields as $ key ) { $ property = $ this -> { $ key } ; if ( $ property instanceof DateTime ) { $ out [ $ key ] = $ property -> format ( DateTime :: ISO8601 ) ; } else { $ out [ $ key ] = $ property ; } } return $ out ; }
Get an array of class properties

@return array
Get an array of class properties