Erebot  latest
A modular IRC bot for PHP 5.3+
Erebot\Event\Match\CollectionAbstract Class Reference

Abstract class for a filter which groups several (sub-)filters together. More...

+ Inheritance diagram for Erebot\Event\Match\CollectionAbstract:

Public Member Functions

 __construct ()
 
add ($filter)
 
 count ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
remove ($filter)
 
- Public Member Functions inherited from Erebot\Interfaces\Event\Match
 match (\Erebot\Interfaces\Event\Base\Generic $event)
 

Protected Attributes

 $submatchers
 Subfilters of this filter.
 

Detailed Description

Abstract class for a filter which groups several (sub-)filters together.

This abstract class also implements the ArrayAccess & Countable interfaces, so that you may count() the number of subfilters associated with it and/or get/set those subfilters using the usual array notation.

Definition at line 33 of file CollectionAbstract.php.

Constructor & Destructor Documentation

Erebot\Event\Match\CollectionAbstract::__construct ( )

Creates a new instance of this filter.

Note
You may pass instances that implement the Erebot::Interfaces::Event::Match interface as initial subfilters of this filter.

Definition at line 49 of file CollectionAbstract.php.

Member Function Documentation

& Erebot\Event\Match\CollectionAbstract::add (   $filter)

Adds one or more subfilters to this filter.

Return values
Erebot::Event::Match::CollectionAbstractReturns this instance, so that multiple calls to Erebot::Event::Match::CollectionAbstract::add() can be chained up together.
Parameters
$filter,...One or more filters to add as subfilters of this filter. Duplicates are silently ignored.

Definition at line 105 of file CollectionAbstract.php.

Erebot\Event\Match\CollectionAbstract::count ( )

Count elements of an object.

This method is executed when using the count() function on an object implementing the Countable interface.

Return values
intThe custom count as an integer.
See also
http://php.net/countable.count.php

Implements Countable.

Definition at line 61 of file CollectionAbstract.php.

Erebot\Event\Match\CollectionAbstract::offsetExists (   $offset)

Whether or not an offset exists.

This method is executed when using isset() or empty() on objects implementing ArrayAccess.

Parameters
mixed$offsetAn offset to check for.
Return values
booltrue is returned when the offset exists, false when it doesn't.
See also
http://php.net/arrayaccess.offsetexists.php
Note
When using empty() ArrayAccess::offsetGet() will be called and checked for emptyness only if ArrayAccess::offsetExists() returns true.

Implements ArrayAccess.

Definition at line 67 of file CollectionAbstract.php.

Erebot\Event\Match\CollectionAbstract::offsetGet (   $offset)

Returns the value at specified offset.

This method is executed when checking if offset is empty().

Parameters
mixed$offsetThe offset to retrieve.
Return values
mixedValue at the specified offset.
See also
http://php.net/arrayaccess.offsetget.php

Implements ArrayAccess.

Definition at line 73 of file CollectionAbstract.php.

Erebot\Event\Match\CollectionAbstract::offsetSet (   $offset,
  $value 
)

Assigns a value to the specified offset.

Parameters
mixed$offsetThe offset to assign the value to.
mixed$valueThe value to set.
See also
http://php.net/arrayaccess.offsetset.php

Implements ArrayAccess.

Definition at line 79 of file CollectionAbstract.php.

Erebot\Event\Match\CollectionAbstract::offsetUnset (   $offset)

Unsets an offset.

Parameters
mixed$offsetThe offset to unset.
See also
http://php.net/arrayaccess.offsetunset.php
Note
This method will not be called when type-casting to (unset).

Implements ArrayAccess.

Definition at line 88 of file CollectionAbstract.php.

& Erebot\Event\Match\CollectionAbstract::remove (   $filter)

Removes one or more subfilters from this filter.

Return values
Erebot::Event::Match::CollectionAbstractReturns this instance, so that multiple calls to Erebot::Event::Match::CollectionAbstract::remove() can be chained up together.
Parameters
$filter,...One or more filters to remove from this filter's subfilters. Filters which are not currently subfilters of this filter are silently ignored.

Definition at line 132 of file CollectionAbstract.php.


The documentation for this class was generated from the following file: