Scalr_UI_Controller_Tools_Aws_Route53_Recordsets::xListAction PHP Method

xListAction() public method

public xListAction ( string $zoneId, string $type = null, string $aliases = null, string $weighted = null )
$zoneId string
$type string optional
$aliases string optional
$weighted string optional
    public function xListAction($zoneId, $type = null, $aliases = null, $weighted = null)
    {
        $resultList = [];
        $nextName = null;
        $nextType = null;
        do {
            if (isset($recordListResponse)) {
                $nextName = $recordListResponse->nextRecordName;
                $nextType = $recordListResponse->nextRecordType;
            }
            $recordListResponse = $this->getAws()->route53->record->describe($zoneId, $nextName, $nextType);
            foreach ($recordListResponse as $record) {
                if (!empty($type) && $record->type != $type) {
                    continue;
                }
                if (!empty($aliases) && empty($record->aliasTarget->zoneId)) {
                    continue;
                }
                if (!empty($weighted) && !property_exists($record, 'weight')) {
                    continue;
                }
                $result = self::loadRecordSetData($record);
                $resultList[] = $result;
            }
        } while (!empty($recordListResponse->isTruncated));
        $response = $this->buildResponseFromData($resultList, ['name', 'type'], true);
        $this->response->data($response);
    }