Subclass of yrData. Subclass of yrData. Class for holding structured weather data parsed from XML.
<?php
class yrDataContainer implements ArrayAccess, Countable, Iterator {
/*
Class for emulating yr data as array/object hierarchy.
*/
// The data stored by the class
private $data;
// Used for printing data to screen
private $tab;
public function __construct()
public function __set($key, $val)
/*
Set a value.
$key (string): Value name
$val (mixed): Value
Returns nothing.
*/
public function __get($key)
/*
Get a value
$key (string): Value name.
Returns (mixed): Value. Null if value does not exist.
*/
public function __toString()
/*
Creates a string representation of the object.
*/
public function count()
/*
Returns number of values stored.
*/
public function offsetExists($offset)
/*
Returns TRUE if row at $offset is set, else FALSE.
*/
public function offsetGet($offset)
/*
Returns value at offset $offset. NULL and triggers a PHP error if $offset is not set.
*/
public function offsetSet($offset, $value)
/*
Sets value at $offset to $value.
Equivalent to function __set(), except this emulates arrays.
Returns nothing.
*/
public function offsetUnset($offset)
/*
Unsets value at offset $offset. Returns TRUE if $offset exits.
Returns FALSE and triggers PHP error if $offset is not set.
*/
public function current()
/*
Returns the current object in array.
*/
public function key()
/*
Returns the key of the current object in array.
*/
public function next()
/*
Advance the internal array pointer.
*/
public function rewind()
/*
Rewind the Iterator to the first element.
*/
public function valid()
/*
Rewind the Iterator to the first element.
*/
public function setTab($tab)
/*
For the __toString-function: Sets number of whitespaces before data.
*/
}
?>