Example:
Get all objects beginning with the prefix 'photo'
$objects = $bucket->objects([
'prefix' => 'photo',
'fields' => 'items/name,nextPageToken'
]);
foreach ($objects as $object) {
echo $object->name() . PHP_EOL;
}
public objects ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration options. @type string $delimiter Returns results in a directory-like mode. Results will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. @type integer $maxResults Maximum number of results to return per request. Defaults to `1000`. @type string $prefix Filter results with this prefix. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. @type bool $versions If true, lists all versions of an object as distinct results. The default is false. @type string $fields Selector which will cause the response to only return the specified fields. } |
return | Generator |