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