Filter messages by type.

@param string $type

@return $this
332501
public function byType($type)
    {
        $filtered_messages = $this->filterMessage('type', $type);

        $this->filtered = $filtered_messages;

        return $this;
    }
1071307
protected function addFilters($type, $filters)
	{
		if (isset($this->action[$type]))
		{
			$this->action[$type] .= '|'.$filters;
		}
		else
		{
			$this->action[$type] = $filters;
		}

		return $this;
	}
256643
public function add($message = null, $type = 'notice')
    {
        if (!isset($this->messages[$type]) || !is_array($this->messages[$type])) {
            $this->messages[$type] = [];
        }
        if ($message) {
            $this->messages[$type][] = $message;
        }
        $this->writeToSession();
        return $this;
    }
1146598
public function clear($type = FALSE)
  {
    
	if ($type === FALSE){
		
		$this->_session_unset();
	}
	else {
		
		$messages = $this->_session_get();
		
		if (is_array($messages))
		{		
			foreach($messages as $i=>$message){
			
				if ($message->type == $type){
					
					unset($messages[$i]);
				}
			}
			
			if (!$this->count())
			{
				$this->clear();
			}
			else {
			
				$this->_session_set($messages);
			}
		}
	}
	
    return $this;
  }
722836
public function addToGrouping($type)
    {
        if (!$this->typeIsAvailable($type)) {
            return $this;
        }

        if (!in_array($type, $this->groupForRender)) {
            $this->groupForRender[] = $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();
    }
1071870
public function removeDisallowedType($type)
    {
        if (in_array(strtolower($type), $this->disallowedTypes)) {
            unset($this->disallowedTypes[array_search(strtolower($type), $this->disallowedTypes)]);
        }
        return $this;
    }
1081968
public function set($type, $messages)
    {
        foreach((array) $messages as $message) {
            parent::set($type, $message);
        }

        return $this;
    }
247290
public function mustBeTypeOf(string $type) : Slot
    {
        static $allowed_types = [
            'boolean',
            'bool',
            'integer',
            'int',
            'float',
            'double',
            'string',
            'array',
            'object',
            'resource',
            'NULL',
            'null',
        ];
        $this->type = in_array($type,$allowed_types) ? $type : self::TYPE_ANY;
        return $this;
    }
205999
public function notify($type = 'default')
    {
        if (isset($this->observers[$type])) {
            foreach ($this->observers[$type] as $obs) {
                $obs->update($this);
            }
        }
        return $this;
    }
1314668
public function setType($type)
    {
        $this->type = (string)$type;
        $this->getDocBlock()->getTagCollection()->removeByName(Tag::TAG_VAR);

        $tag = Tag::createFromProperty($this);

        $this->getDocBlock()->addTag($tag);

        return $this;
    }
1172524
protected function notify($message, $type = 'info')
    {
        if ($this->notifier) {
            $messages = is_array($message) ? $message : [$message];
            foreach ($messages as $text) {
                if ($type === 'error') {
                    $this->notifier->error($text);
                } else {
                    $this->notifier->info($text);
                }
            }
        }

        return $this;
    }
919489
protected function ftFilter($type)
    {
        if ($type === Column::TYPE_TEXT)
        {
            return array_map(function ($v) {
                return trim($v, '%');
            }, $this->searcher->query);
        }
        return $this->searcher->query;

    }
325613
public function setType(Type $type)
    {
        if ($this->type !== $type) {
            $this->type = $type;
            $type->setItem($this);
        }

        return $this;
    }
416202
public function trigger($type)
    {
        if (isset($this->callbacks[$type])) {
            foreach ($this->callbacks[$type] as $cb) {
                \pwf\helpers\SystemHelpers::call($this->prepareCallback($cb));
            }
        }
        return $this;
    }
1216735
public function type($type)
    {
        $types = is_array($type) ? $type : func_get_args();

        $this->types = array_merge($this->types, $types);

        return $this;
    }
398096
public function restrictTo(string $type)
    {
        if (count($this) > 0) {
            throw new CollectionException('Type restriction could not be applied to a non empty collection');
        }

        $this->type = $type;

        return $this;
    }