original_string: public function buildMimeIds($id = null, $rfc822 = false)
      {
          $this->_status &= ~self::STATUS_REINDEX;
  
          if (is_null($id)) {
              $rfc822 = true;
              $id = '';
          }
  
          if ($rfc822) {
              if (empty($this->_parts) &&
                  ($this->getPrimaryType() != 'multipart')) {
                  $this->setMimeId($id . '1');
              } else {
                  if (empty($id) && ($this->getType() == 'message/rfc822')) {
                      $this->setMimeId('1.0');
                  } else {
                      $this->setMimeId($id . '0');
                  }
                  $i = 1;
                  foreach ($this as $val) {
                      $val->buildMimeIds($id . ($i++));
                  }
              }
          } else {
              $this->setMimeId($id);
              $id = $id
                  ? ((substr($id, -2) === '.0') ? substr($id, 0, -1) : ($id . '.'))
                  : '';
  
              if (count($this)) {
                  if ($this->getType() == 'message/rfc822') {
                      $this->rewind();
                      $this->current()->buildMimeIds($id, true);
                  } else {
                      $i = 1;
                      foreach ($this as $val) {
                          $val->buildMimeIds($id . ($i++));
                      }
                  }
              }
          }
      }
code: public function buildMimeIds($id = null, $rfc822 = false)
      {
          $this->_status &= ~self::STATUS_REINDEX;
  
          if (is_null($id)) {
              $rfc822 = true;
              $id = '';
          }
  
          if ($rfc822) {
              if (empty($this->_parts) &&
                  ($this->getPrimaryType() != 'multipart')) {
                  $this->setMimeId($id . '1');
              } else {
                  if (empty($id) && ($this->getType() == 'message/rfc822')) {
                      $this->setMimeId('1.0');
                  } else {
                      $this->setMimeId($id . '0');
                  }
                  $i = 1;
                  foreach ($this as $val) {
                      $val->buildMimeIds($id . ($i++));
                  }
              }
          } else {
              $this->setMimeId($id);
              $id = $id
                  ? ((substr($id, -2) === '.0') ? substr($id, 0, -1) : ($id . '.'))
                  : '';
  
              if (count($this)) {
                  if ($this->getType() == 'message/rfc822') {
                      $this->rewind();
                      $this->current()->buildMimeIds($id, true);
                  } else {
                      $i = 1;
                      foreach ($this as $val) {
                          $val->buildMimeIds($id . ($i++));
                      }
                  }
              }
          }
      }
code_tokens: public function buildMimeIds ( $ id = null , $ rfc822 = false ) { $ this -> _status &= ~ self :: STATUS_REINDEX ; if ( is_null ( $ id ) ) { $ rfc822 = true ; $ id = '' ; } if ( $ rfc822 ) { if ( empty ( $ this -> _parts ) && ( $ this -> getPrimaryType ( ) != 'multipart' ) ) { $ this -> setMimeId ( $ id . '1' ) ; } else { if ( empty ( $ id ) && ( $ this -> getType ( ) == 'message/rfc822' ) ) { $ this -> setMimeId ( '1.0' ) ; } else { $ this -> setMimeId ( $ id . '0' ) ; } $ i = 1 ; foreach ( $ this as $ val ) { $ val -> buildMimeIds ( $ id . ( $ i ++ ) ) ; } } } else { $ this -> setMimeId ( $ id ) ; $ id = $ id ? ( ( substr ( $ id , - 2 ) === '.0' ) ? substr ( $ id , 0 , - 1 ) : ( $ id . '.' ) ) : '' ; if ( count ( $ this ) ) { if ( $ this -> getType ( ) == 'message/rfc822' ) { $ this -> rewind ( ) ; $ this -> current ( ) -> buildMimeIds ( $ id , true ) ; } else { $ i = 1 ; foreach ( $ this as $ val ) { $ val -> buildMimeIds ( $ id . ( $ i ++ ) ) ; } } } } }
docstring: Build the MIME IDs for this part and all subparts.
  
  @param string $id       The ID of this part.
  @param boolean $rfc822  Is this a message/rfc822 part?
docstring_tokens: Build the MIME IDs for this part and all subparts .