Generate jobs

@return Eve\Framework\Cli\Generate
779205
public function generateJobs()
    {
        $destinationRoot = $this->cwd
            . $this->schema['paths']['job']
            . '/' . ucwords($this->schema['name']);

        if(!is_dir($destinationRoot)) {
            mkdir($destinationRoot, 0777, true);
        }

        foreach($this->schema['job'] as $action => $instructions) {
            $source = $this->source . '/Job.html';

            $destination = $destinationRoot . '/' . ucwords($action) . '.php';

            $this->schema['job_action'] = strtolower($action);
            $this->schema['job_instructions'] = $instructions;

            $this->copy($source, $destination);
        }
    }
1318021
public function getJob()
    {
        $this->resolveChildren();

        $job = new Job($this->getJobConfig());

        foreach ($this->children as $child) {
            $job->add($child->getJob());
        }

        return $job;
    }
937707
public function generate()
    {
        $saved = $this->factoryMuffin->isPendingOrSaved($this->model);

        return call_user_func($this->kind, $this->model, $saved);
    }
716561
protected function createWidgetGenerator()
    {
        $generator = new WidgetGenerator($this->getContainer()->get('filesystem'));
        $generator->setTemplating($this->getContainer()->get('twig'));

        return $generator;
    }
340573
public function generateNextJob(): self
    {
        $tokens = $this->getJobTokens();
        $tokens['token'] = $tokens['next_token'];
        $tokens['next_token'] = Uuid::uuid4()->toString();

        return new self($this->getName(), $this->getArguments(), $tokens);
    }
39579
public function getFinishedJobs()
    {
        while (count($this->jobs) !== 0) {
            foreach ($this->jobs as $index => $job) {
                if ($job->isFinished()) {
                    unset($this->jobs[$index]);
                    yield $index => $job;
                }
            }
        }
    }
414266
public function generate()
    {
        $name = substr($this->kind, strlen(static::getPrefix()));

        return $this->factory($name);
    }
394100
private function generate()
	{
		// only load sections if we dont have a cache
		$this->discoverComponentSections();

		// generate output by processing sections
		$this->output['sections'] = $this->processComponentSections($this->sections);

		// remove duplicate available versions & order
		$this->output['versions']['available'] = array_unique($this->output['versions']['available']);

		// get the highest version available
		$this->output['versions']['max'] = end($this->output['versions']['available']);

		// create cache folder
		$cacheFile = PATH_APP . DS . 'cache' . DS . 'api' . DS . 'documentation.json';

		if (App::has('filesystem') && !App::get('filesystem')->exists(dirname($cacheFile)))
		{
			App::get('filesystem')->makeDirectory(dirname($cacheFile));
		}

		// save cache file
		file_put_contents($cacheFile, json_encode($this->output));
	}
143868
protected function generateServicesClasses()
    {
        foreach ($this->getGenerator()->getServices(true) as $service) {
            $file = new ServiceFile($this->generator, $service->getPackagedName());
            $file->setModel($service)->write();
        }
        return $this;
    }
815524
public function generate()
    {
        if (empty($this->hosts)) {
            $host = $this->router->getContext()->getHost();
            $this->hosts = [$host];
        }
        if ($this->scheme === null) {
            $this->scheme = $this->router->getContext()->getScheme();
        }
        $schemeMode = Host::SCHEME_HTTP;
        if ($this->scheme == 'https') {
            $schemeMode = Host::SCHEME_HTTPS;
        } elseif ($this->scheme == 'https_only') {
            $schemeMode = Host::SCHEME_ONLY_HTTPS;
        }
        if (file_exists($this->webDir.'/robots.txt')) {
            unlink($this->webDir.'/robots.txt');
        }
        foreach ($this->hosts as $hostName) {
            $postfix = (count($this->hosts) > 1 ? '.'.$hostName : '');
            $host = new Host($hostName, $schemeMode, $this->port);
            $sitemap = new Sitemap($host);
            $this->configureRobotsFile($sitemap->getRobotsFile());
            $event = new SitemapGenerateEvent($sitemap);
            $this->eventDispatcher->dispatch(SitemapGenerateEvent::ON_SITEMAP_GENERATE, $event);
            $sitemap->save($this->webDir, $this->gzip, $postfix);
        }
    }
1118448
private function generateClass(): ServiceDTOGenerator
    {
        $this->DTOFile = (new PhpFile())
            ->addComment('This file is auto-generated.');

        $namespace = $this->inputData['namespace'] . '\\' . $this->inputData['module'] . 'Module\\' . $this->inputData['type'];

        $this->DTOClass = $this->DTOFile
            ->addNamespace($namespace)
            ->addClass($this->inputData['class'] . $this->inputData['type'])
            ->addComment($this->inputData['class'] . ' service ' . strtolower($this->inputData['type']) . PHP_EOL)
            ->addComment('@package ' . $namespace);

        return $this;
    }
1005732
public function generate()
    {
        $elts = array(
            uniqid(),
            mt_rand(),
            getmypid(),
            spl_object_hash($this)
        );
        if (function_exists('zend_thread_id')) {
            $elts[] = zend_thread_id();
        }
        if (function_exists('sys_getloadavg') &&
            ($loadavg = sys_getloadavg())) {
            $elts = array_merge($elts, $loadavg);
        }
        if (function_exists('memory_get_usage')) {
            $elts[] = memory_get_usage();
            $elts[] = memory_get_peak_usage();
        }

        shuffle($elts);

        /* Base64 can have /, +, and = characters. Restrict to URL-safe
         * characters. */
        return substr(str_replace(
            array('/', '+', '='),
            array('-', '_', ''),
            base64_encode(hash('sha1', serialize($elts), true))
        ), 0, 23);
    }
251653
protected function generate()
	{
		if ( $this->fields ) {
			parent::fire();

			if ( $this->log ) {
				$file = $this->datePrefix . '_' . $this->migrationName;
				$this->repository->log($file, $this->batch);
			}
		}
	}
159500
public function generate()
    {
        $output = [];

        $fields = array_keys(get_object_vars($this));

        foreach ($fields as $field) {
            if (($value = $this->generateValue($this->$field)) !== null) {
                $output[$field] = $value;
            }
        }

        return $output;
    }
550637
public function layers() : Generator
    {
        yield $this->input;
        
        foreach ($this->hidden as $hidden) {
            yield $hidden;
        }

        yield $this->output;
    }
440958
public function generateResources()
    {
        $this->console->call('component:make-seed', [
            'name'      => $this->getName(),
            'component' => $this->getName(),
            '--master'  => true,
        ]);

        $this->console->call('component:make-provider', [
            'name'      => $this->getName() . 'ServiceProvider',
            'component' => $this->getName(),
            '--master'  => true,
        ]);

        $this->console->call('component:make-controller', [
            'controller' => $this->getName() . 'Controller',
            'component'  => $this->getName(),
        ]);
    }
891188
public function getJobList()
    {
        $propertyList = $this->_getEntityList('Jobs');
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = Job::createFromOptions($properties);
        }

        return $result;
    }