Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Enum
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
    • Queues
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

  • ArrayCollection
  • PaginatedIterator
  • ResourceIterator
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class ResourceIterator

A generic, abstract collection class that allows collections to exhibit array functionality.

OpenCloud\Common\ArrayAccess implements ArrayAccess
Extended by OpenCloud\Common\Collection\ArrayCollection implements Countable
Extended by OpenCloud\Common\Collection\ResourceIterator implements Iterator

Direct known subclasses

OpenCloud\Common\Collection\PaginatedIterator

Indirect known subclasses

OpenCloud\DNS\Collection\DnsIterator
Namespace: OpenCloud\Common\Collection
Package: OpenCloud\Common\Collection
Located at OpenCloud/Common/Collection/ResourceIterator.php
Methods summary
public static
# factory( mixed $parent, array $options = array(), array $data = array() )
protected
# parseOptions( array $options )
public mixed
# setResourceParent( mixed $parent )

Parameters

$parent
mixed
$parent

Returns

mixed
$this
public mixed
# setOptions( array $options )

Parameters

$options
array
$options

Returns

mixed
$this
public array
# getOptions( )

Returns

array
Options for the resource iterator.
public mixed
# setOption( mixed $key, mixed $value )

Set a particular option.

Set a particular option.

Parameters

$key
mixed
$key
$value
mixed
$value

Returns

mixed
$this
public null
# getOption( mixed $key )

Parameters

$key
mixed
$key

Returns

null
public boolean
# valid( )

This method is called after self::rewind() and self::next() to check if the current position is valid.

This method is called after self::rewind() and self::next() to check if the current position is valid.

Returns

boolean

Implementation of

Iterator::valid()
public
# next( )

Increment the current pointer by 1, and also update the current marker.

Increment the current pointer by 1, and also update the current marker.

Implementation of

Iterator::next()
public
# rewind( )

Reset the pointer and current marker.

Reset the pointer and current marker.

Implementation of

Iterator::rewind()
public mixed
# current( )

Returns

mixed

Implementation of

Iterator::current()
public mixed
# currentElement( )

Returns

mixed
public mixed
# constructResource( mixed $object )

Using a standard object, this method populates a resource model with all the object data. It does this using a whatever method the parent object has for resource creation.

Using a standard object, this method populates a resource model with all the object data. It does this using a whatever method the parent object has for resource creation.

Parameters

$object
mixed
$object Standard object

Returns

mixed

Throws

OpenCloud\Common\Exceptions\CollectionException
public integer|mixed
# key( )

Return the current position/internal pointer.

Return the current position/internal pointer.

Returns

integer|mixed

Implementation of

Iterator::key()
public
# getElement( mixed $offset )
public
# sort( )
public
# search( mixed $callback )
Methods inherited from OpenCloud\Common\Collection\ArrayCollection
__construct(), append(), count(), setElements(), valueExists()
Methods inherited from OpenCloud\Common\ArrayAccess
offsetExists(), offsetGet(), offsetSet(), offsetUnset()
Properties summary
protected integer $position
#

Internal pointer of the iterator - reveals its current position.

Internal pointer of the iterator - reveals its current position.

protected object $resourceParent
#

The parent object which resource models are instantiated from. The parent needs to have appropriate
methods to instantiate the particular object.

The parent object which resource models are instantiated from. The parent needs to have appropriate methods to instantiate the particular object.

protected array $options
#

The options for this iterator.

The options for this iterator.

protected array $defaults array('limit.total' => 1000)
#

Fallback defaults if options are not explicitly set or provided.

Fallback defaults if options are not explicitly set or provided.

protected array $required array()
#

Required options

Required options

Properties inherited from OpenCloud\Common\Collection\ArrayCollection
$elements
PHP OpenCloud API API documentation generated by ApiGen 2.8.0