protected function load_hd_grant()
    {

        if ($this->_rights_records_preview) {
            return $this;
        }

        try {
            $tmp_rights = $this->get_data_from_cache(self::CACHE_RIGHTS_RECORDS);
            $this->_rights_records_preview = $tmp_rights['preview'];
            $this->_rights_records_document = $tmp_rights['document'];

            return $this;
        } catch (\Exception $e) {

        }
        $sql = "SELECT sbas_id, record_id, preview, document FROM records_rights WHERE usr_id = :usr_id";

        $stmt = $this->app->getApplicationBox()->get_connection()->prepare($sql);
        $stmt->execute([':usr_id' => $this->user->getId()]);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();
        unset($stmt);

        $this->_rights_records_preview = [];
        $this->_rights_records_document = [];

        foreach ($rs as $row) {
            $currentid = $row["sbas_id"] . "_" . $row["record_id"];
            if ($row['document'] == '1')
                $this->_rights_records_document[$currentid] = $currentid;
            $this->_rights_records_preview[$currentid] = $currentid;
        }

        $datas = [
            'preview'  => $this->_rights_records_preview,
            'document' => $this->_rights_records_document
        ];

        $this->set_data_to_cache($datas, self::CACHE_RIGHTS_RECORDS);

        return $this;
    }
protected function load_hd_grant()
    {

        if ($this->_rights_records_preview) {
            return $this;
        }

        try {
            $tmp_rights = $this->get_data_from_cache(self::CACHE_RIGHTS_RECORDS);
            $this->_rights_records_preview = $tmp_rights['preview'];
            $this->_rights_records_document = $tmp_rights['document'];

            return $this;
        } catch (\Exception $e) {

        }
        $sql = "SELECT sbas_id, record_id, preview, document FROM records_rights WHERE usr_id = :usr_id";

        $stmt = $this->app->getApplicationBox()->get_connection()->prepare($sql);
        $stmt->execute([':usr_id' => $this->user->getId()]);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();
        unset($stmt);

        $this->_rights_records_preview = [];
        $this->_rights_records_document = [];

        foreach ($rs as $row) {
            $currentid = $row["sbas_id"] . "_" . $row["record_id"];
            if ($row['document'] == '1')
                $this->_rights_records_document[$currentid] = $currentid;
            $this->_rights_records_preview[$currentid] = $currentid;
        }

        $datas = [
            'preview'  => $this->_rights_records_preview,
            'document' => $this->_rights_records_document
        ];

        $this->set_data_to_cache($datas, self::CACHE_RIGHTS_RECORDS);

        return $this;
    }
protected function load_hd_grant ( ) { if ( $ this -> _rights_records_preview ) { return $ this ; } try { $ tmp_rights = $ this -> get_data_from_cache ( self :: CACHE_RIGHTS_RECORDS ) ; $ this -> _rights_records_preview = $ tmp_rights [ 'preview' ] ; $ this -> _rights_records_document = $ tmp_rights [ 'document' ] ; return $ this ; } catch ( \ Exception $ e ) { } $ sql = "SELECT sbas_id, record_id, preview, document FROM records_rights WHERE usr_id = :usr_id" ; $ stmt = $ this -> app -> getApplicationBox ( ) -> get_connection ( ) -> prepare ( $ sql ) ; $ stmt -> execute ( [ ':usr_id' => $ this -> user -> getId ( ) ] ) ; $ rs = $ stmt -> fetchAll ( PDO :: FETCH_ASSOC ) ; $ stmt -> closeCursor ( ) ; unset ( $ stmt ) ; $ this -> _rights_records_preview = [ ] ; $ this -> _rights_records_document = [ ] ; foreach ( $ rs as $ row ) { $ currentid = $ row [ "sbas_id" ] . "_" . $ row [ "record_id" ] ; if ( $ row [ 'document' ] == '1' ) $ this -> _rights_records_document [ $ currentid ] = $ currentid ; $ this -> _rights_records_preview [ $ currentid ] = $ currentid ; } $ datas = [ 'preview' => $ this -> _rights_records_preview , 'document' => $ this -> _rights_records_document ] ; $ this -> set_data_to_cache ( $ datas , self :: CACHE_RIGHTS_RECORDS ) ; return $ this ; }
Load if needed the elements which have a HD grant

@return Array
Load if needed the elements which have a HD grant