public function get($type)
    {
        $collection = new Collection();

        foreach ($this->notifications as $key => $message) {
            if ($message->getType() == $type) {
                $collection->add($message);
            }
        }

        return $collection;
    }
public function get($type)
    {
        $collection = new Collection();

        foreach ($this->notifications as $key => $message) {
            if ($message->getType() == $type) {
                $collection->add($message);
            }
        }

        return $collection;
    }
public function get ( $ type ) { $ collection = new Collection ( ) ; foreach ( $ this -> notifications as $ key => $ message ) { if ( $ message -> getType ( ) == $ type ) { $ collection -> add ( $ message ) ; } } return $ collection ; }
Returns all messages for given type.

@param $type
@return \Krucas\Notification\Collection
Returns all messages for given type .