Create the resource on transifex.

@return \CyberSpectrum\Transifex\TranslationResource
436991
public function create()
    {
        $params = array(
            'slug' => $this->ensureParameter('slug'),
            'name' => $this->ensureParameter('name'),
            'i18n_type' => $this->ensureParameter('i18nType'),
            'content' => $this->ensureParameter('content'),
        );

        $this->post(
            sprintf('project/%s/resources/', $this->ensureParameter('project')),
            $params
        );

        return $this;
    }
271511
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $resource = new WorkflowRelease();

        $resource->setWorkflowFinder($serviceLocator->getServiceLocator()->get(\Prooph\Link\ProcessManager\Projection\Workflow\WorkflowFinder::class));

        return $resource;
    }
1304978
public function getMetadata(): Resource {
        $meta = (new Graph())->resource('.');

        $meta->addType(RC::get('fedoraServiceClass'));

        $meta->addResource(RC::idProp(), $this->getId());

        $meta->addLiteral(RC::titleProp(), $this->getId());

        $meta->addLiteral(RC::get('fedoraServiceLocProp'), $this->location);

        $retProp = RC::get('fedoraServiceRetFormatProp');
        foreach ($this->format as $i) {
            $meta->addLiteral($retProp, $i);
        }
        
        $meta->addLiteral(RC::get('fedoraServiceRevProxyProp'), $this->revProxy);

        return $meta;
    }
959469
public function build()
    {
        $config           = $this->getConfig();
        $cluster          = $this->getCluster();
        $resolverFactory  = $config->getResolverFactory();
        $converterFactory = $config->getConverterFactory();

        $cluster->setNodes($this->nodes);
        $resolverFactory->setResolvers($this->resolvers);
        $converterFactory->setConverters($this->converters);

        return new RiakClient($config, $cluster);
    }
674405
public function build(): DeliverPushMessageRequest
	{
		$instance = new DeliverPushMessageRequest();
		if ($this->origin === null) {
			throw new BuilderException('Property [origin] is required.');
		}
		$instance->origin = $this->origin;
		if ($this->registrationId === null) {
			throw new BuilderException('Property [registrationId] is required.');
		}
		$instance->registrationId = $this->registrationId;
		if ($this->data === null) {
			throw new BuilderException('Property [data] is required.');
		}
		$instance->data = $this->data;
		return $instance;
	}
1124648
public function actionCreate()
    {
        
        $extensionsToCreate = explode(',', $this->options['extension']);
        $extensionsToCreate = array_unique($extensionsToCreate);
        
        foreach ($extensionsToCreate as $etc){
        	$this->options['extension'] = $etc;
        	$this->options['input'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_INPUT_DIR;
        	$this->options['output'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_OUTPUT_DIR;
        	
        	$this->outVerbose("Creating language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        	 
        	// We first create the directory where locale files will go.
        	$dir = $this->buildLanguagePath($this->options['extension'], $this->options['language']);
        	$dirExists = false;
        	
        	if (file_exists($dir) && is_dir($dir) && $this->options['force'] == true) {
        		$dirExists = true;
        		$this->outVerbose("Language '" . $this->options['language'] . "' exists for extension '" . $this->options['extension'] . "'. Creation will be forced.");
        		 
        		// Clean it up.
        		foreach (scandir($dir) as $d) {
        			if ($d !== '.' && $d !== '..' && $d !== '.svn') {
        				if (!tao_helpers_File::remove($dir . '/' . $d, true)) {
        					$this->err("Unable to clean up 'language' directory '" . $dir . "'.", true);
        				}
        			}
        		}
        	} else if (file_exists($dir) && is_dir($dir) && $this->options['force'] == false) {
        		$this->err("The 'language' " . $this->options['language'] . " already exists in the file system. Use the 'force' parameter to overwrite it.", true);
        	}
        	
        	// If we are still here... it means that we have to create the language directory.
        	if (!$dirExists && !@mkdir($dir)) {
        		$this->err("Unable to create 'language' directory '" . $this->options['language'] . "'.", true);
        	} else {
        		if ($this->options['build'] == true) {
        			$sortingMethod = tao_helpers_translation_TranslationFile::SORT_ASC_I;
        			$this->outVerbose("Building language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        			// Let's populate the language with raw PO files containing sources but no targets.
        			// Source code extraction.
        			$fileExtensions = array('php', 'tpl', 'js', 'ejs');
        			$filePaths = array();
        			foreach (self::$WHITE_LIST as $subFolder) {
        			    $filePaths[] = $this->options['input'] . DIRECTORY_SEPARATOR. $subFolder;
        			}
        			 
        			$sourceExtractor = new tao_helpers_translation_SourceCodeExtractor($filePaths, $fileExtensions);
        			$sourceExtractor->extract();
        	
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$translationFile->addTranslationUnits($sourceExtractor->getTranslationUnits());
        			
        			$file = MenuService::getStructuresFilePath($this->options['extension']);
        			if (!is_null($file)) {
            			$structureExtractor = new tao_helpers_translation_StructureExtractor(array($file));
            			$structureExtractor->extract();
            			$translationFile->addTranslationUnits($structureExtractor->getTranslationUnits());
        			}

        			$sortedTus = $translationFile->sortBySource($sortingMethod);
        	
        			$sortedTranslationFile = new tao_helpers_translation_POFile();
        			$sortedTranslationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$sortedTranslationFile->setTargetLanguage($this->options['language']);
        			$sortedTranslationFile->addTranslationUnits($sortedTus);
        			$this->preparePOFile($sortedTranslationFile, true);

        			$poPath = $dir . '/' . self::DEF_PO_FILENAME;
        			$writer = new tao_helpers_translation_POFileWriter($poPath,
        					$sortedTranslationFile);
        			$writer->write();
        			$this->outVerbose("PO Translation file '" . basename($poPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
        			$writer->write();

					// Writing JS files
					$jsPath = $dir . '/' . self::DEF_JS_FILENAME;
        			$writer = new tao_helpers_translation_JSFileWriter(
						 $jsPath, $sortedTranslationFile
					);
        			$writer->write(false);
					$this->outVerbose("JavaScript Translation file '" . basename($jsPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
					$writer->write();

        			// Now that PO files & JS files are created, we can create the translation models
        			// if we find RDF models to load for this extension.
        			$translatableProperties = array(OntologyRdfs::RDFS_LABEL, OntologyRdfs::RDFS_COMMENT);
        	
        			foreach ($this->getOntologyFiles() as $f){
       					common_Logger::d('reading rdf '.$f);
						$translationFile = $this->extractPoFileFromRDF($f, $translatableProperties);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
       					$writer->write();

       					$this->outVerbose("PO Translation file '" .  $this->getOntologyPOFileName($f) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		} else {
        			// Only build virgin files.
        			// (Like a virgin... woot !)
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$this->preparePOFile($translationFile, true);

        			foreach ($this->getOntologyFiles() as $f){
                            common_Logger::d('reading rdf '.$f);
                            $translationFile = new tao_helpers_translation_POFile();
        					$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        					$translationFile->setTargetLanguage($this->options['language']);
        					$translationFile->setExtensionId($this->options['extension']);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
                        $writer->write();
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		}
        	
        		// Create the language manifest in RDF.
        		if ($this->options['extension'] == 'tao'){
        			$langDescription = tao_helpers_translation_RDFUtils::createLanguageDescription($this->options['language'],
        					$this->options['languageLabel']);
        			$langDescription->save($dir . '/' . self::DEF_LANG_FILENAME);
        		}
        	}	
        }
        
    }
145014
public function getMetadata(): Resource {
        $meta = (new Graph())->resource('.');

        $meta->addResource(RC::relProp(), $this->service->getResource()->getId());
        $meta->addResource(RC::idProp(), $this->getId());
        $meta->addLiteral(RC::titleProp(), 'A dissemination service matching rule');

        $meta->addResource(RC::get('fedoraServiceMatchProp'), $this->property);
        $meta->addLiteral(RC::get('fedoraServiceMatchValue'), $this->value);
        $meta->addLiteral(RC::get('fedoraServiceMatchRequired'), $this->required);

        return $meta;
    }
78051
public function createResource($path)
    {
        $response = $this->httpRequest($path, Requests::POST, $this);

        return $this->populate($response);
    }
1063127
public function build(): GetResourceContentRequest
	{
		$instance = new GetResourceContentRequest();
		if ($this->frameId === null) {
			throw new BuilderException('Property [frameId] is required.');
		}
		$instance->frameId = $this->frameId;
		if ($this->url === null) {
			throw new BuilderException('Property [url] is required.');
		}
		$instance->url = $this->url;
		return $instance;
	}
150512
function createResources() {
    if( 0 >= count( $this->resources ))
      return;
    $output = null;
    foreach( $this->resources as $resource ) {
      $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' ));
      if( is_array( $resource['value'] )) {
        foreach( $resource['value'] as $rix => $resourcePart )
          $resource['value'][$rix] = $this->_strrep( $resourcePart );
        $content  = implode( ',', $resource['value'] );
      }
      else
        $content  = $this->_strrep( $resource['value'] );
      $output    .= $this->_createElement( 'RESOURCES', $attributes, $content );
    }
    return $output;
  }
990625
static public function create()
    {
        $t = new static();

        $t->registerService(new Service\Youtube());
        $t->registerService(new Service\Dailymotion());
        $t->registerService(new Service\Vimeo());
        $t->registerService(new Service\Spotify());
        $t->registerService(new Service\SoundCloud());

        return $t;
    }
350552
public function create()
    {
        $instance = self::createCancelOperation($this);
        $this->setId($instance->getId());
        return $instance;
    }
841287
public static function createFromResource(Resource $resource, array $options = [])
    {
        $entity = new self();

        $entity->applyResource($resource);

        return $entity;
    }
500880
public function create()
    {
        $instance = self::createCountry($this);
        $this->setId($instance->getId());
        return $instance;
    }
1106725
public function getResource(): object
    {
        \mysqli_report(MYSQLI_REPORT_ALL);

        return new mysqli(
            $this->options['host'],
            $this->options['user'],
            $this->options['password'],
            $this->options['database'],
            $this->options['port']
        );
    }
1020955
public function build(): StartViolationsReportRequest
	{
		$instance = new StartViolationsReportRequest();
		if ($this->config === null) {
			throw new BuilderException('Property [config] is required.');
		}
		$instance->config = $this->config;
		return $instance;
	}
534065
public function getAvailableResources()
    {
        $cache = Cache::getTransientCache();
        $cacheId = 'transifex_resources_' . $this->projectSlug;
        $resources = $cache->fetch($cacheId);

        if (empty($resources)) {
            $apiPath = 'project/' . $this->projectSlug . '/resources';
            $resources = $this->getApiResults($apiPath);
            $cache->save($cacheId, $resources);
        }

        return $resources;
    }