← Request | Result(中文) | Region →
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();