public function setConfigValue($moduleId, $variableName, $variableValue, $valueLocale = null, $createIfNotExists = true)
    {
        $configValue = self::create()
            ->filterByModuleId($moduleId)
            ->filterByName($variableName)
            ->findOne();
        ;

        if (null === $configValue) {
            if (true === $createIfNotExists) {
                $configValue = new ModuleConfig();

                $configValue
                    ->setModuleId($moduleId)
                    ->setName($variableName)
                ;
            } else {
                throw new \LogicException("Module configuration variable $variableName does not exists. Create it first.");
            }
        }

        if (null !== $valueLocale) {
            $configValue->setLocale($valueLocale);
        }

        $configValue
            ->setValue($variableValue)
            ->save();
        ;

        return $this;
    }