removes the closest-to-top block of the given type and all other
blocks encountered while going down the block stack

@param string $type block type (name)
@return string the output of all postProcessing() method's return values of the closed blocks
768154
public function removeBlock($type)
	{
		$output = '';

		$pluginType = $this->getPluginType($type);
		if ($pluginType & Dwoo::SMARTY_BLOCK) {
			$type = 'smartyinterface';
		}
		while (true) {
			while ($top = array_pop($this->stack)) {
				if ($top['custom']) {
					$class = $top['class'];
				} else {
					$class = 'Dwoo_Plugin_'.$top['type'];
				}
				if (count($this->stack)) {
					$this->curBlock =& $this->stack[count($this->stack)-1];
					$this->push(call_user_func(array($class, 'postProcessing'), $this, $top['params'], '', '', $top['buffer']), 0);
				} else {
					$null = null;
					$this->curBlock =& $null;
					$output = call_user_func(array($class, 'postProcessing'), $this, $top['params'], '', '', $top['buffer']);
				}

				if ($top['type'] === $type) {
					break 2;
				}
			}

			throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of type "'.$type.'" was closed but was not opened');
			break;
		}

		return $output;
	}
34777
public function getSessionLock( $type = '' )
	{
		$context = $this->_getContext();
		$session = $context->getSession();
		$locale = $context->getLocale();
		$currency = $locale->getCurrencyId();
		$language = $locale->getLanguageId();
		$sitecode = $locale->getSite()->getCode();
		$key = 'arcavias/basket/lock-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type );

		if( ( $value = $session->get( $key ) ) !== null ) {
			return (int) $value;
		}

		return MShop_Order_Manager_Base_Abstract::LOCK_DISABLE;
	}
1014156
public static function getAndAssertActiveBlock($type)
    {
        $active_block = static::getActive();
        $current = get_class($active_block->activeBlock());
        if ( !is_a($active_block->activeBlock(), $type)) {
            throw new Exception("Improperly nested block. Expected a $type, got a $current");
        }
        return $active_block;
    }
241024
public function clear($type = null)
    {
        if (false === $this->mf->hasCache()) {
            return [];
        }
        return $this->doClear($this->getTypes($type));
    }
21267
protected function getLevelByType($type)
    {
        $level = 0;

        if (isset($this->availableLogtypes[$type])) {
            $level = $this->availableLogtypes[$type];
        }

        return $level;
    }
1121336
function getBlock(type) {
  switch (type) {
    case 'Radio':
    case 'Bool':
      return Radio;

    case 'Checkbox':
      return Checkbox;

    case 'Number':
      return Number;

    case 'Select':
      return Select;

    case 'Image':
      return Image;

    case 'Text':
      return Text;

    case 'Input':
      return Input;

    case 'Textarea':
      return Textarea;

    case 'Data':
      return Data;

    case 'Evaluation':
      return Evaluation;

    case 'FetchOrg':
      return FetchOrg;

    case 'Table':
      return Table;

    case 'Signature':
      return Signature;

    case 'Summary':
      return Summary;

    case 'Sum':
      return Sum;

    case 'Switch':
      return Switch;

    case 'Information':
      return Information;

    default:
      return null;
  }
}
550828
public function get($type = FALSE)
  {
    $result = $this->peek($type);
	
    $this->clear($type);
	
    return $result;
  }
295492
protected function skip($type)
    {
        if ($match = ($this->token->getType() === $type)) {
            $this->advance();
        }

        return $match;
    }
673207
public function clear($type = null)
    {
        if (is_null($type)) {
            $_SESSION[$this->key] = [];
        } else {
            unset($_SESSION[$this->key][$type]);
        }

        return $this;
    }
727569
public function deleteType($type)
    {
        $contents = $this->contentType->findBy(array('type' => $type));

        foreach ($contents as $content) {
            $this->deleteContent($content->getContent());
        }

        $this->manager->remove($type);
        $this->manager->flush();
    }
61108
public function removeTopBlock()
	{
		$o = array_pop($this->stack);
		if ($o === null) {
			throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of unknown type was closed but was not opened.');
		}
		if ($o['custom']) {
			$class = $o['class'];
		} else {
			$class = 'Dwoo_Plugin_'.$o['type'];
		}

		$this->curBlock =& $this->stack[count($this->stack)-1];

		return call_user_func(array($class, 'postProcessing'), $this, $o['params'], '', '', $o['buffer']);
	}
782882
public function finish($type = 'NORMAL')
    {
        $this->finished = true;
        if ($type === 'BROKEN') {
            $this->res->error = Connection::getLastError();
        } else {
            if ($type !== 'NORMAL') {
                $this->res->error = ucfirst(strtolower($type));
            }
        }
        // gzip decode
        $encoding = $this->res->getHeader('content-encoding');
        if ($encoding !== null && strstr($encoding, 'gzip')) {
            $this->res->body = Client::gzdecode($this->res->body);
        }
        // parser
        $this->res->timeCost = microtime(true) - $this->timeBegin;
        $this->cli->runParser($this->res, $this->req, $this->key);
        // conn
        if ($this->conn) {
            // close conn
            $close = $this->res->getHeader('connection');
            $this->conn->close($type !== 'NORMAL' || !strcasecmp($close, 'close'));
            $this->conn = null;
            // redirect
            if (($this->res->status === 301 || $this->res->status === 302)
                && $this->res->numRedirected < $this->req->getMaxRedirect()
                && ($location = $this->res->getHeader('location')) !== null
            ) {
                Client::debug('redirect to \'', $location, '\'');
                $req = $this->req;
                if (!preg_match('/^https?:\/\//i', $location)) {
                    $pa = $req->getUrlParams();
                    $url = $pa['scheme'] . '://' . $pa['host'];
                    if (isset($pa['port'])) {
                        $url .= ':' . $pa['port'];
                    }
                    if (substr($location, 0, 1) == '/') {
                        $url .= $location;
                    } else {
                        $url .= substr($pa['path'], 0, strrpos($pa['path'], '/') + 1) . $location;
                    }
                    $location = $url; /// FIXME: strip relative '../../'
                }
                // change new url
                $prevUrl = $req->getUrl();
                $req->setUrl($location);
                if (!$req->getHeader('referer')) {
                    $req->setHeader('referer', $prevUrl);
                }
                if ($req->getMethod() !== 'HEAD') {
                    $req->setMethod('GET');
                }
                $req->clearCookie();
                $req->setHeader('host', null);
                $req->setHeader('x-server-ip', null);
                $req->setHeader('content-type', null);
                $req->setBody(null);
                // reset response
                $this->res->numRedirected++;
                $this->finished = $this->headerOk = false;
                return $this->res->reset();
            }
        }
        Client::debug('finished', $this->res->hasError() ? ' (' . $this->res->error . ')' : '');
        $this->req = $this->cli = null;
    }
591732
protected function _cleanedUrl($type) {
		$type = (array)$type;
		if (Configure::read('Config.productive')) {
			$type[] = 'pwd';
		}

		return Setup::cleanedUrl($type, $this->Controller->request->getAttribute('params') + ['?' => $this->Controller->request->getQuery()]);
	}
15428
protected function typeToPDOParamType($type)
    {
        switch ($type) {
        case "boolean":
            return PDO::PARAM_BOOL;
        case "integer":
            return PDO::PARAM_STR;
        case "NULL":
            return PDO::PARAM_NULL;
        case "resource":
            return PDO::PARAM_LOB;
        case "double":
        case "string":
        default:
            return PDO::PARAM_STR;
        }
    }
998677
public function removeAllowedMimeType($type)
    {
        $key = array_search($type, $this->allowedMimeTypes);
        if ($key !== false) {
            unset($this->allowedMimeTypes[$key]);
            return true;
        }


        return false;
    }
1205420
public static function getStackByType($type)
    {
        foreach (self::getStacks() as $stack) {
            if ($stack->isType($type)) {
                return $stack;
            }
        }
        return new Stacks\NullStack();
    }
203333
public static function removeHeader($type) {
		
		if(false == is_string($type)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
		}

		header_remove($type);
	}