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

getList() public method

retrieve the named property as an associative array, even if it is actually an object
public getList ( string $propName ) : array
$propName string
return array
    public function getList($propName)
    {
        // do we have the property at all?
        if (!isset($this->{$propName})) {
            // no ... send back an empty list
            return array();
        }
        // is the property already a list?
        if (is_array($this->{$propName})) {
            // yes ... no conversion needed
            return $this->{$propName};
        }
        // is the property something we can convert?
        if (is_object($this->{$propName})) {
            // yes
            $return = array();
            foreach ($this->{$propName} as $key => $value) {
                $return[$key] = $value;
            }
            return $return;
        }
        // if we get here, the property isn't naturally a list
        return array();
    }