Scalr\Service\Aws\Rds\V20130110\RdsApi::describeDBSubnetGroups PHP Method

describeDBSubnetGroups() public method

If a DBSubnetGroupName is specified, the list will contain only the descriptions of the specified DBSubnetGroup.
public describeDBSubnetGroups ( string $dBSubnetGroupName = null, string $marker = null, string $maxRecords = null ) : Scalr\Service\Aws\Rds\DataType\DBSubnetGroupList
$dBSubnetGroupName string optional Subnet group name
$marker string optional Pagination token, provided by a previous request.
$maxRecords string optional The maximum number of records to include in the response.
return Scalr\Service\Aws\Rds\DataType\DBSubnetGroupList Returns the list of the DBSubnetGroupData
    public function describeDBSubnetGroups($dBSubnetGroupName = null, $marker = null, $maxRecords = null)
    {
        $result = null;
        $options = [];
        $action = ucfirst(__FUNCTION__);
        if ($dBSubnetGroupName !== null) {
            $options['DBSubnetGroupName'] = (string) $dBSubnetGroupName;
        }
        if ($marker !== null) {
            $options['Marker'] = (string) $marker;
        }
        if ($maxRecords !== null) {
            $options['MaxRecords'] = (int) $maxRecords;
        }
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->{$action . 'Result'})) {
                throw new RdsException(sprintf(self::UNEXPECTED, $action));
            }
            $ptr = $sxml->{$action . 'Result'};
            $result = new DBSubnetGroupList();
            $result->setRds($this->rds);
            $result->marker = $this->exist($ptr->Marker) ? (string) $ptr->Marker : null;
            if (isset($ptr->DBSubnetGroups->DBSubnetGroup)) {
                foreach ($ptr->DBSubnetGroups->DBSubnetGroup as $v) {
                    $item = $this->_loadDBSubnetGroupData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }