public function find($name, $return = true)
	{
		foreach ($this as $entity)
		{
			if ($entity->isFile())
			{
				if ($entity->getName() == $name)
				{
					return ($return) ? $entity : true;
				}
			}
			else
			{
				// The result of this is already flat, so no need for recursion
				foreach ($entity->listContents(true) as $sub)
				{
					if ($sub->getName() == $name)
					{
						return ($return) ? $sub : true;
					}
				}
			}
		}

		return false;
	}
public function find($name, $return = true)
	{
		foreach ($this as $entity)
		{
			if ($entity->isFile())
			{
				if ($entity->getName() == $name)
				{
					return ($return) ? $entity : true;
				}
			}
			else
			{
				// The result of this is already flat, so no need for recursion
				foreach ($entity->listContents(true) as $sub)
				{
					if ($sub->getName() == $name)
					{
						return ($return) ? $sub : true;
					}
				}
			}
		}

		return false;
	}
public function find ( $ name , $ return = true ) { foreach ( $ this as $ entity ) { if ( $ entity -> isFile ( ) ) { if ( $ entity -> getName ( ) == $ name ) { return ( $ return ) ? $ entity : true ; } } else { // The result of this is already flat, so no need for recursion foreach ( $ entity -> listContents ( true ) as $ sub ) { if ( $ sub -> getName ( ) == $ name ) { return ( $ return ) ? $ sub : true ; } } } } return false ; }
Finds the first entity with a given name, optionally returning it

@param   string  $name    The name of the entity to find
@param   bool    $return  Whether or not to return the found entity
@return  \Hubzero\Filesystem\File|\Hubzero\Filesystem\Directory|bool
Finds the first entity with a given name optionally returning it