src/Core/SettingsTrait.php
public function settingsGetAll()
    {
        global $CFG;
        $name = $this->ENTITY_NAME;
        $retval = $this->ltiParameter($name."_settings", false);

        // Null means in the session - false means not in the session
        if ( $retval === null || ( is_string($retval) && strlen($retval) < 1 ) ) {
            $retval = array();
        } else if ( strlen($retval) > 0 ) {
            try {
                $retval = json_decode($retval, true);
            } catch(Exception $e) {
                $retval = array();
            }
        }
        // echo("Session $name: "); var_dump($retval);
        if ( is_array($retval) ) return $retval;

        $row = $this->launch->pdox->rowDie("SELECT settings FROM {$CFG->dbprefix}{$this->TABLE_NAME}
            WHERE {$name}_id = :ID",
            array(":ID" => $this->id));

        if ( $row === false ) return array();
        $json = $row['settings'];
        if ( $json === null ) return array();
        try {
            $retval = json_decode($json, true);
        } catch(Exception $e) {
            $retval = array();
        }

        // Put in session for quicker retrieval
        $this->ltiParameterUpdate($name."_settings", json_encode($retval));
        // echo("<hr>From DB\n");var_dump($retval);
        return $retval;
    }
public function settingsGetAll()
    {
        global $CFG;
        $name = $this->ENTITY_NAME;
        $retval = $this->ltiParameter($name."_settings", false);

        // Null means in the session - false means not in the session
        if ( $retval === null || ( is_string($retval) && strlen($retval) < 1 ) ) {
            $retval = array();
        } else if ( strlen($retval) > 0 ) {
            try {
                $retval = json_decode($retval, true);
            } catch(Exception $e) {
                $retval = array();
            }
        }
        // echo("Session $name: "); var_dump($retval);
        if ( is_array($retval) ) return $retval;

        $row = $this->launch->pdox->rowDie("SELECT settings FROM {$CFG->dbprefix}{$this->TABLE_NAME}
            WHERE {$name}_id = :ID",
            array(":ID" => $this->id));

        if ( $row === false ) return array();
        $json = $row['settings'];
        if ( $json === null ) return array();
        try {
            $retval = json_decode($json, true);
        } catch(Exception $e) {
            $retval = array();
        }

        // Put in session for quicker retrieval
        $this->ltiParameterUpdate($name."_settings", json_encode($retval));
        // echo("<hr>From DB\n");var_dump($retval);
        return $retval;
    }
public function settingsGetAll ( ) { global $ CFG ; $ name = $ this -> ENTITY_NAME ; $ retval = $ this -> ltiParameter ( $ name . "_settings" , false ) ; // Null means in the session - false means not in the session if ( $ retval === null || ( is_string ( $ retval ) && strlen ( $ retval ) < 1 ) ) { $ retval = array ( ) ; } else if ( strlen ( $ retval ) > 0 ) { try { $ retval = json_decode ( $ retval , true ) ; } catch ( Exception $ e ) { $ retval = array ( ) ; } } // echo("Session $name: "); var_dump($retval); if ( is_array ( $ retval ) ) return $ retval ; $ row = $ this -> launch -> pdox -> rowDie ( "SELECT settings FROM {$CFG->dbprefix}{$this->TABLE_NAME}
            WHERE {$name}_id = :ID" , array ( ":ID" => $ this -> id ) ) ; if ( $ row === false ) return array ( ) ; $ json = $ row [ 'settings' ] ; if ( $ json === null ) return array ( ) ; try { $ retval = json_decode ( $ json , true ) ; } catch ( Exception $ e ) { $ retval = array ( ) ; } // Put in session for quicker retrieval $ this -> ltiParameterUpdate ( $ name . "_settings" , json_encode ( $ retval ) ) ; // echo("<hr>From DB\n");var_dump($retval); return $ retval ; }
Retrieve an array of all of the settings

If there are no settings, return an empty array.
Retrieve an array of all of the settings