public function first($filter = null) {
		if (!$filter) {
			return $this->rewind();
		}
		foreach ($this as $item) {
			if ($filter($item)) {
				return $item;
			}
		}
	}
public function first($filter = null) {
		if (!$filter) {
			return $this->rewind();
		}
		foreach ($this as $item) {
			if ($filter($item)) {
				return $item;
			}
		}
	}
public function first ( $ filter = null ) { if ( ! $ filter ) { return $ this -> rewind ( ) ; } foreach ( $ this as $ item ) { if ( $ filter ( $ item ) ) { return $ item ; } } }
Rewinds the collection and returns the first item or when a filter is used,
returns the first non-empty item after the filter is applied.

@see lithium\util\Collection::rewind()
@param callable $filter An optional callable through which items  will be passed.
If the return value of this function is trueish, it will be returned as
the result of the method call. An example filter function may look like:
`function($item) { return $item->year < 2005; }`.
@return mixed Returns the first item in the collection or when `$filter` is used,
the first item where `$filter` returned a trueish result.
Rewinds the collection and returns the first item or when a filter is used returns the first non - empty item after the filter is applied .