Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NArrayList
  • NCollection
  • NHashtable
  • NSet

Interfaces

  • ICollection
  • IList
  • IMap
  • ISet

Exceptions

  • NKeyNotFoundException
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NCollection

SPL ArrayObject customization.

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by NCollection implements ICollection

Direct known subclasses

NArrayList, NHashtable, NSet

Indirect known subclasses

NConfig, NMultiRouter
Abstract
Package: Nette\Collections
Author: David Grudl
Located at Collections/Collection.php
Methods summary
public
# __construct( array $arr = NULL, string $type = NULL )

Parameters

$arr
array
to wrap
$type
string
class/interface name or ':type'

Throws

InvalidArgumentException
public
# append( mixed $item )

Appends the specified element to the end of this collection.

Appends the specified element to the end of this collection.

Parameters

$item
mixed

Throws

InvalidArgumentException
public boolean
# remove( mixed $item )

Removes the first occurrence of the specified element.

Removes the first occurrence of the specified element.

Parameters

$item
mixed

Returns

boolean
true if this collection changed as a result of the call

Throws

NotSupportedException

Implementation of

ICollection::remove
protected integer|false
# search( mixed $item )

Returns the index of the first occurrence of the specified element,. or FALSE if this collection does not contain this element.

Returns the index of the first occurrence of the specified element,. or FALSE if this collection does not contain this element.

Parameters

$item
mixed

Returns

integer|false
public
# clear( )

Removes all of the elements from this collection.

Removes all of the elements from this collection.

Throws

NotSupportedException

Implementation of

ICollection::clear
public boolean
# contains( mixed $item )

Returns true if this collection contains the specified item.

Returns true if this collection contains the specified item.

Parameters

$item
mixed

Returns

boolean

Implementation of

ICollection::contains
public
# import( array|Traversable $arr )

Import from array or any traversable object.

Import from array or any traversable object.

Parameters

$arr
array|Traversable

Throws

InvalidArgumentException
public string
# getItemType( )

Returns the item type.

Returns the item type.

Returns

string
protected
# beforeAdd( mixed $item )

Responds when the item is about to be added to the collection.

Responds when the item is about to be added to the collection.

Parameters

$item
mixed

Throws

InvalidArgumentException,
NotSupportedException
public NArrayIterator
# getIterator( )

Returns the iterator.

Returns the iterator.

Returns

NArrayIterator

Implementation of

IteratorAggregate::getIterator
public
# exchangeArray( $array )

Not supported. Use import().

Not supported. Use import().

protected NCollection
# setArray( array $array )

Protected exchangeArray().

Protected exchangeArray().

Parameters

$array
array
new array

Returns

NCollection
provides a fluent interface
public NClassReflection
# getReflection( )

Returns

NClassReflection
public
# __call( $name, $args )

Call to undefined method.

Call to undefined method.

Throws

MemberAccessException
public static
# __callStatic( $name, $args )

Call to undefined static method.

Call to undefined static method.

Throws

MemberAccessException
public &
# __get( $name )

Returns property value. Do not call directly.

Returns property value. Do not call directly.

Throws

MemberAccessException
if the property is not defined.
public
# __set( $name, $value )

Sets value of a property. Do not call directly.

Sets value of a property. Do not call directly.

Throws

MemberAccessException
if the property is not defined or is read-only
public boolean
# __isset( string $name )

Is property defined?

Is property defined?

Parameters

$name
string
property name

Returns

boolean
public
# __unset( $name )

Access to undeclared property.

Access to undeclared property.

Throws

MemberAccessException
public
# freeze( )

Makes the object unmodifiable.

Makes the object unmodifiable.

final public boolean
# isFrozen( )

Is the object unmodifiable?

Is the object unmodifiable?

Returns

boolean
public
# __clone( )

Creates a modifiable clone of the object.

Creates a modifiable clone of the object.

protected
# updating( )
Methods inherited from ArrayObject
asort(), count(), getArrayCopy(), getFlags(), getIteratorClass(), ksort(), natcasesort(), natsort(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), serialize(), setFlags(), setIteratorClass(), uasort(), uksort(), unserialize()
Constants inherited from ArrayObject
ARRAY_AS_PROPS, STD_PROP_LIST
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0