DataSift\Storyplayer\PlayerLib\Story_Checkpoint::getProperties_asList PHP Method

getProperties_asList() public method

convert our public properties to an array
public getProperties_asList ( $prefix = null ) : array
return array
    public function getProperties_asList($prefix = null)
    {
        $return = array();
        // get a list of the properties of the $params object
        $refObj = new ReflectionObject($this);
        $refProps = $refObj->getProperties(ReflectionProperty::IS_PUBLIC);
        // convert each property into an array entry
        foreach ($refProps as $refProp) {
            $propKey = $refProp->getName();
            $retKey = $propKey;
            // do we need to enforce the prefix?
            if ($prefix !== null && substr($this->{$propKey}, 0, strlen($prefix)) !== $prefix) {
                // yes we do
                $retKey = $prefix . $propKey;
            }
            // set the value
            $return[$retKey] = $this->{$propKey};
        }
        // return the array that we've built
        return $return;
    }