public function inCollection($varValue, $blnReturnKey = false)
    {
        $varReturn = false;
        foreach ($this->collection as $object) {
            if ($object == $varValue || $varValue === get_class($object)) {
                $varReturn = ($blnReturnKey) ? $this->key() : true;
                break;
            }
        }

        // *** Reset the internal pointer.
        self::rewind();

        return $varReturn;
    }
public function inCollection($varValue, $blnReturnKey = false)
    {
        $varReturn = false;
        foreach ($this->collection as $object) {
            if ($object == $varValue || $varValue === get_class($object)) {
                $varReturn = ($blnReturnKey) ? $this->key() : true;
                break;
            }
        }

        // *** Reset the internal pointer.
        self::rewind();

        return $varReturn;
    }
public function inCollection ( $ varValue , $ blnReturnKey = false ) { $ varReturn = false ; foreach ( $ this -> collection as $ object ) { if ( $ object == $ varValue || $ varValue === get_class ( $ object ) ) { $ varReturn = ( $ blnReturnKey ) ? $ this -> key ( ) : true ; break ; } } // *** Reset the internal pointer. self :: rewind ( ) ; return $ varReturn ; }
Check if an object is in the collection

@param mixed $varValue Value to search for
@param boolean $blnReturnKey If true, returns the position of the item if found. Default: false.
Check if an object is in the collection