public function read($id)
    {
        $result = $this->_table
            ->find('all')
            ->select(['data'])
            ->where([$this->_table->getPrimaryKey() => $id])
            ->disableHydration()
            ->first();

        if (empty($result)) {
            return '';
        }

        if (is_string($result['data'])) {
            return $result['data'];
        }

        $session = stream_get_contents($result['data']);

        if ($session === false) {
            return '';
        }

        return $session;
    }
public function read($id)
    {
        $result = $this->_table
            ->find('all')
            ->select(['data'])
            ->where([$this->_table->getPrimaryKey() => $id])
            ->disableHydration()
            ->first();

        if (empty($result)) {
            return '';
        }

        if (is_string($result['data'])) {
            return $result['data'];
        }

        $session = stream_get_contents($result['data']);

        if ($session === false) {
            return '';
        }

        return $session;
    }
public function read ( $ id ) { $ result = $ this -> _table -> find ( 'all' ) -> select ( [ 'data' ] ) -> where ( [ $ this -> _table -> getPrimaryKey ( ) => $ id ] ) -> disableHydration ( ) -> first ( ) ; if ( empty ( $ result ) ) { return '' ; } if ( is_string ( $ result [ 'data' ] ) ) { return $ result [ 'data' ] ; } $ session = stream_get_contents ( $ result [ 'data' ] ) ; if ( $ session === false ) { return '' ; } return $ session ; }
Method used to read from a database session.

@param string|int $id ID that uniquely identifies session in database.
@return string Session data or empty string if it does not exist.
Method used to read from a database session .