Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CDN
      • Resource
    • CloudMonitoring
      • Collection
      • 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
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Enum
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

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

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\CloudMonitoring\Collection\MonitoringIterator, OpenCloud\DNS\Collection\DnsIterator, OpenCloud\LoadBalancer\Collection\LoadBalancerIterator, OpenCloud\Queues\Collection\MessageIterator
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

Returns

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

Parameters

$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
$value

Returns

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

Parameters

$key

Returns

null
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
bool

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
mixed

Implementation of

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

Returns

mixed
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
object

Returns

mixed
mixed

Throws

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

Return the current position/internal pointer.

Return the current position/internal pointer.

Returns

integer|mixed
int|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

Fallback defaults if options are not explicitly set or provided.

Fallback defaults if options are not explicitly set or provided.

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

Required options

Required options

#array()
Properties inherited from OpenCloud\Common\Collection\ArrayCollection
$elements
API documentation generated by ApiGen 2.8.0