public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false)
    {
        if ($check) {
            $cname = $this->_getHeaderClassName($ob->name);
            if (!($ob instanceof $cname)) {
                throw new InvalidArgumentException(sprintf(
                    'Object is not correct class: %s',
                    $cname
                ));
            }
        }

        /* Existing header? Add to that object. */
        if ($hdr = $this[$ob->name]) {
            $hdr->setValue($ob);
        } else {
            $this->_headers[$ob->name] = $ob;
        }
    }
public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false)
    {
        if ($check) {
            $cname = $this->_getHeaderClassName($ob->name);
            if (!($ob instanceof $cname)) {
                throw new InvalidArgumentException(sprintf(
                    'Object is not correct class: %s',
                    $cname
                ));
            }
        }

        /* Existing header? Add to that object. */
        if ($hdr = $this[$ob->name]) {
            $hdr->setValue($ob);
        } else {
            $this->_headers[$ob->name] = $ob;
        }
    }
public function addHeaderOb ( Horde_Mime_Headers_Element $ ob , $ check = false ) { if ( $ check ) { $ cname = $ this -> _getHeaderClassName ( $ ob -> name ) ; if ( ! ( $ ob instanceof $ cname ) ) { throw new InvalidArgumentException ( sprintf ( 'Object is not correct class: %s' , $ cname ) ) ; } } /* Existing header? Add to that object. */ if ( $ hdr = $ this [ $ ob -> name ] ) { $ hdr -> setValue ( $ ob ) ; } else { $ this -> _headers [ $ ob -> name ] = $ ob ; } }
Add a Horde_Mime_Headers_Element object to the current header list.

@since 2.5.0

@param Horde_Mime_Headers_Element $ob  Header object to add.
@param boolean $check                  Check that the header and object
type match?

@throws InvalidArgumentException
Add a Horde_Mime_Headers_Element object to the current header list .