Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.36 KB

4-Result.md

File metadata and controls

55 lines (40 loc) · 1.36 KB

← Request | Result(中文) | Region →


Result

Returned result is not just filed, but the objects with characters like ArrayAccess, IteratorAggregate, Countable, JmesPath et al.

<?php

/**
 * @var AlibabaCloud\Client\Result\Result $result
 */

// Accessing results by objects
echo $result->RequestId;

// Accessing results by array
echo $result['RequestId'];
echo $result['AccessPointSet.AccessPointType'];

// Convert result to array
$result->toArray();

// Convert result to Json
$result->toJson();

// Result contains some fields
$result->has('RequestId');
$result->has('AccessPointSet.AccessPointType');
    
// Is the result empty
$result->isEmpty();
$result->isEmpty('RequestId');
$result->isEmpty('AccessPointSet.AccessPointType');
    
// Search and match from the result
$result->search('AccessPointSet.AccessPointType[0].Name');

// Get a field from the results
$result->get();
$result->get('AccessPointSet.AccessPointType');

// Count result elements
$result->count();
$result->count('AccessPointSet.AccessPointType');

// Is the result requested successful
$result->isSuccess();

// Get the request object from the result
$result->getRequest();

← Request | Result(中文) | Region →