Horde_Mime_Part::clearContents PHP Method

clearContents() public method

Clears the body contents of this part.
public clearContents ( )
    public function clearContents()
    {
        if (!empty($this->_contents)) {
            fclose($this->_contents);
            $this->_contents = null;
            unset($this->_temp['sendTransferEncoding']);
        }
    }

Usage Example

Example #1
0
 /**
  */
 public function serialize()
 {
     /* Don't store Mime_Part data. Can't use clone here ATM, since there
      * appears to be a PHP bug. Since this is an object specific to IMP
      * (and we are only using in a certain predictable way), it should
      * be ok to directly alter the MIME part object without any ill
      * effects. */
     $this->_part->clearContents();
     $this->_isBuilt = false;
     return $GLOBALS['injector']->getInstance('Horde_Pack')->pack(array($this->_composeCache, $this->id, $this->_linked, $this->_part, $this->related, $this->_uuid), array('compression' => false, 'phpob' => true));
 }