SimpleSAML_Session::getDataOfType PHP Method

getDataOfType() public method

The data will be returned as an associative array with the id of the data as the key, and the data as the value of each key. The value will be stored as a copy of the original data. setData must be used to update the data. An empty array will be returned if no data of the given type is found.
public getDataOfType ( string $type ) : array
$type string The type of the data.
return array An associative array with all data of the given type.
    public function getDataOfType($type)
    {
        assert('is_string($type)');
        if (!is_array($this->dataStore)) {
            return array();
        }
        if (!array_key_exists($type, $this->dataStore)) {
            return array();
        }
        $ret = array();
        foreach ($this->dataStore[$type] as $id => $info) {
            $ret[$id] = $info['data'];
        }
        return $ret;
    }