public function fetch($bucket, $flush = true)
    {
        // Ensure that the root node exists
        if (true === empty($_SESSION[self::ROOT_NODE])) {
            $_SESSION[self::ROOT_NODE] = [];
        }
        // Ensure that the bucket exists
        if (true === empty($_SESSION[self::ROOT_NODE][$bucket])) {
            $_SESSION[self::ROOT_NODE][$bucket] = [];
        }
        // Get the messages for the bucket
        $messages = $_SESSION[self::ROOT_NODE][$bucket];
        // Flush the messages if applicable
        if (true === $flush) {
            $this->flush($bucket);
        }
        // Return the messages as an array
        return $messages;
    }
public function fetch($bucket, $flush = true)
    {
        // Ensure that the root node exists
        if (true === empty($_SESSION[self::ROOT_NODE])) {
            $_SESSION[self::ROOT_NODE] = [];
        }
        // Ensure that the bucket exists
        if (true === empty($_SESSION[self::ROOT_NODE][$bucket])) {
            $_SESSION[self::ROOT_NODE][$bucket] = [];
        }
        // Get the messages for the bucket
        $messages = $_SESSION[self::ROOT_NODE][$bucket];
        // Flush the messages if applicable
        if (true === $flush) {
            $this->flush($bucket);
        }
        // Return the messages as an array
        return $messages;
    }
public function fetch ( $ bucket , $ flush = true ) { // Ensure that the root node exists if ( true === empty ( $ _SESSION [ self :: ROOT_NODE ] ) ) { $ _SESSION [ self :: ROOT_NODE ] = [ ] ; } // Ensure that the bucket exists if ( true === empty ( $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] ) ) { $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] = [ ] ; } // Get the messages for the bucket $ messages = $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] ; // Flush the messages if applicable if ( true === $ flush ) { $ this -> flush ( $ bucket ) ; } // Return the messages as an array return $ messages ; }
Fetch the notifications from the driver

@param string $bucket
@param bool $flush
@return array
Fetch the notifications from the driver