src/Daursu/Xero/models/Collection.php
public function setItems($items = array())
	{
		$this->items = array();

		foreach ($items as $key => $item) {
			if ( ! is_numeric($key) && is_array($item)) {

				// Check to see if the item contains many subitems
				if (array_key_exists('1', $item)) {
					$this->setItems($item);
					return false;
				}
				else {
					// This is a single item
					$this->push($item);
				}

			}
			elseif (is_array($item)) {
				$this->push($item);
			}
		}
	}
public function setItems($items = array())
	{
		$this->items = array();

		foreach ($items as $key => $item) {
			if ( ! is_numeric($key) && is_array($item)) {

				// Check to see if the item contains many subitems
				if (array_key_exists('1', $item)) {
					$this->setItems($item);
					return false;
				}
				else {
					// This is a single item
					$this->push($item);
				}

			}
			elseif (is_array($item)) {
				$this->push($item);
			}
		}
	}
public function setItems ( $ items = array ( ) ) { $ this -> items = array ( ) ; foreach ( $ items as $ key => $ item ) { if ( ! is_numeric ( $ key ) && is_array ( $ item ) ) { // Check to see if the item contains many subitems if ( array_key_exists ( '1' , $ item ) ) { $ this -> setItems ( $ item ) ; return false ; } else { // This is a single item $ this -> push ( $ item ) ; } } elseif ( is_array ( $ item ) ) { $ this -> push ( $ item ) ; } } }
Set all the items at once

@param array $items
Set all the items at once