public function createFactory($config)
    {
        $this->fileService->mkdir(dirname($config['_path_factory_']), 0777, true);

        if (!file_exists($config['_path_factory_'])) {
            $this->putIfNotExists($config['_path_factory_'], '<?php');
        }

        $factory = $this->fileService->get($config['template_source'].'/Factory.txt');

        $factory = $this->tableService->getTableSchema($config, $factory);

        foreach ($config as $key => $value) {
            $factory = str_replace($key, $value, $factory);
        }

        return $this->filesystem->append($config['_path_factory_'], $factory);
    }