public function setErrorCorrection($error_correction)
    {
        if (!is_numeric($error_correction)) {
            $level_constant = 'CodeItNow\BarcodeBundle\Utils\QrCode::LEVEL_'.strtoupper($error_correction);
            $error_correction = constant($level_constant);
        }

        if (in_array($error_correction, $this->error_corrections_available)) {
            $this->error_correction = $error_correction;
        }

        return $this;
    }