Determines if/how a body part was MIME decoded on the server.

@param string $id  The MIME ID.

@return string  Either '8bit', 'binary', or null.
492683
public function getBodyPartDecode($id)
    {
        return isset($this->_data[Horde_Imap_Client::FETCH_BODYPART][$id])
            ? $this->_data[Horde_Imap_Client::FETCH_BODYPART][$id]['d']
            : null;
    }
471455
protected function prepareId($id) {
		if (! is_scalar($id)) {
			$id = json_encode($id);
			
			if (isset($id[33])) {
				$id = md5($id);
			}
		}
		
		if ($this->namespace === null) {
			return $id;
		}
		
		return $this->namespace . '_' . $id;
	}
1134626
public static function parseCacheId($id)
    {
        $data = array(
            'H' => 'highestmodseq',
            'M' => 'messages',
            'U' => 'uidnext',
            'V' => 'uidvalidity'
        );
        $info = array();

        foreach (explode('|', $id) as $part) {
            if (isset($data[$part[0]])) {
                $info[$data[$part[0]]] = intval(substr($part, 1));
            }
        }

        return $info;
    }
465349
public function getFromCache($ID)
    {
        /* Compute the path */
        $Database = $this->CacheFolder . "/" . $this->CacheDB;

        /* Lookup for the picture in the cache */
        $CacheInfo = $this->isInCache($ID, true, true);

        /* Not in the cache */
        if (!$CacheInfo) {
            return null;
        }

        /* Get the database extended information */
        $DBPos = $CacheInfo["DBPos"];
        $PicSize = $CacheInfo["PicSize"];

        /* Extract the picture from the solid cache file */
        $Handle = @fopen($Database, "r");
        fseek($Handle, $DBPos);
        $Picture = fread($Handle, $PicSize);
        fclose($Handle);

        /* Return back the raw picture data */
        return $Picture;
    }
527544
public function getCacheId($id = null)
    {
        $id .= serialize($this->state->toArray());

        return sha1($id);
    }
1135282
public static function decodeChunkedBody($body)
    {
        $decBody = '';

        // If mbstring overloads substr and strlen functions, we have to
        // override it's internal encoding
        if (function_exists('mb_internal_encoding') &&
           ((int) ini_get('mbstring.func_overload')) & 2) {

            $mbIntEnc = mb_internal_encoding();
            mb_internal_encoding('ASCII');
        }

        while (trim($body)) {
            if (! preg_match("/^([\da-fA-F]+)[^\r\n]*\r\n/sm", $body, $m)) {

                throw new Zend_Http_Exception("Error parsing body - doesn't seem to be a chunked message");
            }

            $length = hexdec(trim($m[1]));
            $cut = strlen($m[0]);
            $decBody .= substr($body, $cut, $length);
            $body = substr($body, $cut + $length + 2);
        }

        if (isset($mbIntEnc)) {
            mb_internal_encoding($mbIntEnc);
        }

        return $decBody;
    }
1163020
public function getBodyPart($id, $stream = false)
    {
        return $this->_msgText(
            $stream,
            isset($this->_data[Horde_Imap_Client::FETCH_BODYPART][$id])
                ? $this->_data[Horde_Imap_Client::FETCH_BODYPART][$id]['t']
                : null
        );
    }
1134220
public function peek(string $id)
    {
        if (!isset($this->registered[$id])){
            return null;
        }
        return isset($this->instances[$id]) ? $this->instances[$id] : null;
    }
661366
public function getFullHostById($id)
    {
        foreach ($this->hosts as $host => $parameters) {
            if (!isset($parameters['id']) || $parameters['id'] !== $id) {
                continue;
            }

            return $parameters;
        }

        return null;
    }
67111
public function getBodyText($id = 0, $stream = false)
    {
        return $this->_msgText(
            $stream,
            isset($this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id])
                ? $this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id]
                : null
        );
    }
817675
protected function getEncoding($id)
    {
        $header = $this->imapFetchStructure($id);
        $params = $header->parameters ?: [];
            foreach ($params as $k => $v) {
                if (stristr($v->attribute, 'charset')) {
                    return $v->value;
                }
            }
        return 'utf-8';
    }
30810
protected function _id($id)
    {
        if (($id !== null) && isset($this->_options['cache_id_prefix'])) {
            return $this->_options['cache_id_prefix'] . $id; // return with prefix
        }
        return $id; // no prefix, just return the $id passed
    }
53516
public function getSize($id = 0)
    {
        if ($id) {
            return $this->_protocol->fetch('RFC822.SIZE', $id);
        }
        return $this->_protocol->fetch('RFC822.SIZE', 1, INF);
    }
862082
public function articleExists(string $id)
    {
        yield from $this->encoder->writeCommand($this->stream, new Command('STAT', $id));
        $response = yield from $this->encoder->readResponse($this->stream);
        return $response->code() === 223;
    }
1192196
public function get($id)
    {
        $file_name = $this->getFileName($id);

        if (!is_file($file_name) || !is_readable($file_name)) {
            return false;
        }

        $lines    = file($file_name);
        $lifetime = array_shift($lines);
        $lifetime = (int) trim($lifetime);

        if ($lifetime !== 0 && $lifetime < time()) {
            @unlink($file_name);
            return false;
        }
        $serialized = join('', $lines);
        $data       = unserialize($serialized);
        return $data;
    }
234162
public function delete_bit(string $id): ?int
  {
    if ( \bbn\str::is_uid($id) ){
      return $this->db->delete($this->class_cfg['tables']['user_options_bits'], [
        $this->class_cfg['arch']['user_options_bits']['id'] => $id
      ]);
    }
    return null;
  }
915184
public function getContentTypeById($id)
    {
        return $this->om->getRepository($this->configurationManager->getEntityClass('content_type'))->find($id);
    }