POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_HousesList

Source Location: /classes/OTS_HousesList.php

Class OTS_HousesList

Class Overview

Implements interfaces:

  • IteratorAggregate (internal interface)
  • Countable (internal interface)
  • ArrayAccess (internal interface)

Wrapper for houses list.

Wrapper for houses list.

Located in /classes/OTS_HousesList.php [line 23]



		
				Author(s):
		
Information Tags:
Tutorial:  data/ directory resources
Version:  0.1.0
Version:  0.1.3
Since:  0.1.0

Methods

[ Top ]
Method Summary
OTS_HousesList   __construct()   Loads houses information.
int   count()   Returns amount of houses.
OTS_House   getHouse()   Returns house information.
int   getHouseId()   Returns ID of house with given name.
ArrayIterator   getIterator()   Returns iterator handle for loops.
bool   hasHouse()   Checks if given house exists on list.
bool   hasHouseId()   Checks if given house ID exists on list.
bool   offsetExists()   Checks if given element exists.
OTS_House|int   offsetGet()   Returns item from given position.
void   offsetSet()   This method is implemented for ArrayAccess interface.
void   offsetUnset()   This method is implemented for ArrayAccess interface.
void   __set_state()   Magic PHP5 method.
string   __toString()   Returns string representation of object.

[ Top ]
Methods
Constructor __construct  [line 39]

  OTS_HousesList __construct( string $path  )

Loads houses information.

Loads houses information.

Parameters:
string   $path:  Houses file.

API Tags:
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Throws:  DOMException On DOM operation error.
Since:  0.1.0

[ Top ]
count  [line 153]

  int count( )

Returns amount of houses.

Returns amount of houses.


API Tags:
Return:  Count of houses.
Access:  public

Information Tags:
Version:  0.1.0
Since:  0.1.0

Implementation of:
Countable::count

[ Top ]
getHouse  [line 103]

  OTS_House getHouse( int $id  )

Returns house information.

Returns house information.

Parameters:
int   $id:  House ID.

API Tags:
Return:  House information wrapper.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Throws:  OutOfBoundsException If house was not found.
Since:  0.1.0

[ Top ]
getHouseId  [line 134]

  int getHouseId( string $name  )

Returns ID of house with given name.

Returns ID of house with given name.

Parameters:
string   $name:  House name.

API Tags:
Return:  House ID.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Throws:  OutOfBoundsException False if not found.
Since:  0.1.0

[ Top ]
getIterator  [line 163]

  ArrayIterator getIterator( )

Returns iterator handle for loops.

Returns iterator handle for loops.


API Tags:
Return:  Houses list iterator.
Access:  public

Information Tags:
Version:  0.1.0
Since:  0.1.0

Implementation of:
IteratorAggregate::getIterator

[ Top ]
hasHouse  [line 81]

  bool hasHouse( string $name  )

Checks if given house exists on list.

Checks if given house exists on list.

Parameters:
string   $name:  Name.

API Tags:
Return:  If house is set then true.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Since:  0.1.0
Since:  0.1.3

[ Top ]
hasHouseId  [line 121]

  bool hasHouseId( int $id  )

Checks if given house ID exists on list.

Checks if given house ID exists on list.

Parameters:
int   $id:  ID.

API Tags:
Return:  If house is set then true.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Since:  0.1.0
Since:  0.1.3

[ Top ]
offsetExists  [line 174]

  bool offsetExists( string|int $offset  )

Checks if given element exists.

Checks if given element exists.

Parameters:
string|int   $offset:  Array key.

API Tags:
Return:  True if it's set.
Access:  public

Information Tags:
Version:  0.1.0
Since:  0.1.0

Implementation of:
ArrayAccess::offsetExists

[ Top ]
offsetGet  [line 193]

  OTS_House|int offsetGet( string|int $offset  )

Returns item from given position.

Returns item from given position.

Parameters:
string|int   $offset:  Array key.

API Tags:
Return:  If key is an integer (type-sensitive!) then returns house instance. If it's a string then return associated ID found by house name.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Since:  0.1.0

Implementation of:
ArrayAccess::offsetGet

[ Top ]
offsetSet  [line 212]

  void offsetSet( string|int $offset, mixed $value  )

This method is implemented for ArrayAccess interface.

This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause E_OTS_ReadOnly raise.

Parameters:
string|int   $offset:  Array key.
mixed   $value:  Field value.

API Tags:
Access:  public

Information Tags:
Version:  0.1.0
Throws:  E_OTS_ReadOnly Always - this class is read-only.
Since:  0.1.0

Implementation of:
ArrayAccess::offsetSet

[ Top ]
offsetUnset  [line 223]

  void offsetUnset( string|int $offset  )

This method is implemented for ArrayAccess interface.

This method is implemented for ArrayAccess interface. In fact you can't write/append to houses list. Any call to this method will cause E_OTS_ReadOnly raise.

Parameters:
string|int   $offset:  Array key.

API Tags:
Access:  public

Information Tags:
Version:  0.1.0
Throws:  E_OTS_ReadOnly Always - this class is read-only.
Since:  0.1.0

Implementation of:
ArrayAccess::offsetUnset

[ Top ]
__set_state  [line 60]

  void __set_state( array $properties  )

Magic PHP5 method.

Magic PHP5 method. Allows object importing from var_export().

Parameters:
array   $properties:  List of object properties.

API Tags:
Access:  public

Information Tags:
Version:  0.1.0
Throws:  DOMException On DOM operation error.
Since:  0.1.0

[ Top ]
__toString  [line 239]

  string __toString( )

Returns string representation of object.

Returns string representation of object. If any display driver is currently loaded then it uses it's method.


API Tags:
Return:  String representation of object.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.1.0
Since:  0.1.0
Since:  0.1.3

[ Top ]