AdminID = $AdminID; $this->gDatabase = parent::instDB(); if (!$this->ApiKeyExists($AdminID)) { throw new LogicException("This administrator doesn't have an API key."); } } private function getKeyRecord() { $AdminID = $this->AdminID; $record = $this->gDatabase->row( "SELECT * FROM APIKeys WHERE AdminID = ?", $AdminID ); return $record; } public function keysMatch($givenKey) { return (password_verify($givenKey, $this->getKeyRecord()['Keytext'])) ? true : false; } }