public function getTableName(Model $model, ModelConfig $config = null) {
        if (empty($this->models)) {
            throw new \LogicException('AujaConfigurator not configured yet! Call configure first.');
        }

        if (!isset($this->configs[$model->getName()])) {
            throw new \LogicException(sprintf('AujaConfigurator not configured for model %s', $model->getName()));
        }

        $result = null;
        if ($config != null && $config->getTableName() != null) {
            $result = $config->getTableName();
        } else {
            $modelConfig = $this->configs[$model->getName()];
            $result = $modelConfig->getTableName();
        }

        return $result;
    }