Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Traits

  • CollectionTrait
  • ContainerTrait

Trait CollectionTrait

Represents a collection of other assets.

oroboros\core\traits\libraries\container\CollectionTrait uses oroboros\core\traits\libraries\container\ContainerTrait

Direct Known Users

oroboros\core\abstracts\libraries\container\AbstractCollection, oroboros\core\traits\libraries\file\FileCollectionTrait

Indirect Known Users

oroboros\core\libraries\container\Collection

Namespace: oroboros\core\traits\libraries\container
Author: Brian Dayhoff mopsyd@me.com
See: http://www.php-fig.org/psr/psr-11/
Satisfies: \oroboros\core\interfaces\contract\libraries\container\CollectionContract
Located at core/traits/libraries/container/CollectionTrait.php

Methods summary

public
# __construct( array $params = null )

Provides a means of setting multiple values on object instantiation.

Provides a means of setting multiple values on object instantiation.

Parameters

$params
public boolean
# __isset( scalar $name )

Provides compatibility with the PHP native isset() function.

Provides compatibility with the PHP native isset() function.

Parameters

$name

Returns

boolean
public
# __unset( scalar $name )

Provides compatibility with the PHP native unset() function.

Provides compatibility with the PHP native unset() function.

Parameters

$name
public
# __set( scalar $name, mixed $value )

Provides compatibility with the PHP native setter language construct.

Provides compatibility with the PHP native setter language construct.

Parameters

$name
$value
public mixed
# __get( scalar $name )

Provides compatibility with the PHP native getter language construct.

Provides compatibility with the PHP native getter language construct.

Parameters

$name

Returns

mixed
public
# clear( )

Resets the collection to an empty state.

Resets the collection to an empty state.

public oroboros\core\traits\libraries\container\CollectionTrait
# copy( )

Returns a new instance of the same object this trait is instantiated on.

Returns a new instance of the same object this trait is instantiated on.

Returns

oroboros\core\traits\libraries\container\CollectionTrait
public integer
# count( integer $mode = COUNT_NORMAL )

Returns a count of the values in the collection. The $mode parameter does nothing, due to a native PHP bug that prevents recursive counting from working on instances of \Countable, but it must be provided to honor the interface.

Returns a count of the values in the collection. The $mode parameter does nothing, due to a native PHP bug that prevents recursive counting from working on instances of \Countable, but it must be provided to honor the interface.

Parameters

$mode
Currently does nothing due to a native PHP bug

Returns

integer
public mixed
# current( )

Gets the current iterable index, provided to honor the PHP native \Iterable interface.

Gets the current iterable index, provided to honor the PHP native \Iterable interface.

Returns

mixed
public boolean
# isEmpty( )

Returns a boolean determination as to whether the collection is empty.

Returns a boolean determination as to whether the collection is empty.

Returns

boolean
public scalar
# key( )

Provided for compatibility with the PHP native \Iterator interface. Returns the current key assigned to the pointer.

Provided for compatibility with the PHP native \Iterator interface. Returns the current key assigned to the pointer.

Returns

scalar
public array
# jsonSerialize( )

Provided for compatibilibty with the PHP native \JsonSerializable interface.

Provided for compatibilibty with the PHP native \JsonSerializable interface.

Returns

array
public |boolean
# next( )

Provided for compatibility with the PHP native \Iterator interface. Increments the pointer, returns false if it has reached the end of iterable values.

Provided for compatibility with the PHP native \Iterator interface. Increments the pointer, returns false if it has reached the end of iterable values.

Returns

|boolean
public boolean
# offsetExists( scalar $offset )

Provided for compatibility with the PHP native \ArrayAccess interface. Returns a boolean determination as to whether the specified offset exists.

Provided for compatibility with the PHP native \ArrayAccess interface. Returns a boolean determination as to whether the specified offset exists.

Parameters

$offset

Returns

boolean
public mixed
# offsetGet( scalar $offset )

Provided for compatibility with the PHP native \ArrayAccess interface. Returns the value for the specified offset.

Provided for compatibility with the PHP native \ArrayAccess interface. Returns the value for the specified offset.

Parameters

$offset

Returns

mixed
public
# offsetSet( scalar $offset, mixed $value )

Provided for compatibility with the PHP native \ArrayAccess interface. Sets the specified value to the specified offset.

Provided for compatibility with the PHP native \ArrayAccess interface. Sets the specified value to the specified offset.

Parameters

$offset
$value
public
# offsetUnset( scalar $offset )

Provided for compatibility with the PHP native \ArrayAccess interface. Unsets the specified offset.

Provided for compatibility with the PHP native \ArrayAccess interface. Unsets the specified offset.

Parameters

$offset
public
# rewind( )

Provided for compatibility with the PHP native \Iterator interface. Rewinds the iterator. Called natively when loops begin.

Provided for compatibility with the PHP native \Iterator interface. Rewinds the iterator. Called natively when loops begin.

public array
# toArray( )

Returns an array of the values in the collection.

Returns an array of the values in the collection.

Returns

array
public boolean
# valid( )

Provided for compatibility with the PHP native \Iterator interface. Returns a boolean determination as to whether a specified pointer key exists.

Provided for compatibility with the PHP native \Iterator interface. Returns a boolean determination as to whether a specified pointer key exists.

Returns

boolean
protected
# _initializeCollection( array $params = null )

Provides an alternative initialization method if another trait needs to provide a different constructor method.

Provides an alternative initialization method if another trait needs to provide a different constructor method.

Parameters

$params
private
# _init( array $params = null , type $flags,… )

This is the real initialization method. It insures that core initialization logic is not overridden, and backreference always points to this trait on execution.

This is the real initialization method. It insures that core initialization logic is not overridden, and backreference always points to this trait on execution.

Parameters

$params
$flags,…
private
# _autoInit( )

This method will initialize the trait only if it was not already initialized.

This method will initialize the trait only if it was not already initialized.

Methods used from oroboros\core\traits\libraries\container\ContainerTrait

_check(), _get(), _set(), get(), has()

Properties summary

private boolean $_is_initialized

Whether or not the container is initialized

Whether or not the container is initialized

# false
private integer $_collection_pointer

The current iterator pointer index

The current iterator pointer index

# 0
private array $_collection_pointer_keys

The possible iterator pointer indices

The possible iterator pointer indices

# array()
Oroboros Core API documentation generated by ApiGen