/** * Save the consumer nonce in the database * * @param LTI_Consumer_Nonce $nonce * @return bool */ public function Consumer_Nonce_save($nonce) { $key = $nonce->getKey(); $value = $nonce->getValue(); $expires = date('Y-m-d H:i:s', $nonce->expires); $sql = 'INSERT INTO ' . $this->dbTableNamePrefix . LTI_Data_Connector::NONCE_TABLE_NAME . ' (consumer_key, value, expires) VALUES (:key, :value, :expires)'; $query = $this->db->prepare($sql); $query->bindValue('key', $key, PDO::PARAM_STR); $query->bindValue('value', $value, PDO::PARAM_STR); $query->bindValue('expires', $expires, PDO::PARAM_STR); $ok = $query->execute(); return $ok; }