protected function getGerritApprovalByIdentifier($patchSetId, $type, $by)
    {
        $dbHandle = $this->getDatabase()->getDatabaseConnection();

        $query = 'SELECT `id`, `patchset`, `type`, `description`, `value`, `granted_on`, `by`
                  FROM ' . Database::TABLE_APPROVAL . '
                  WHERE `patchset` = :patchset
                        AND `type` = :type
                        AND `by` = :by';
        $statement = $dbHandle->prepare($query);

        $statement->bindParam(':patchset', $patchSetId, \PDO::PARAM_INT);
        $statement->bindParam(':type', $type, \PDO::PARAM_STR);
        $statement->bindParam(':by', $by, \PDO::PARAM_INT);
        $executeResult = $statement->execute();

        $statement = $this->getDatabase()->checkQueryError($statement, $executeResult);
        return $statement->fetch(\PDO::FETCH_ASSOC);
    }