Create a new Section

@param PHPWord_Section_Settings $settings
@return PHPWord_Section
330580
public function createSection($settings = null) {
		$sectionCount = $this->_countSections() + 1;
		
		$section = new PHPWord_Section($sectionCount, $settings);
		$this->_sectionCollection[] = $section;
		return $section;
	}
392926
public function add($field, SectionInterface $section = null): MetaboxInterface
    {
        if ($field instanceof SectionInterface) {
            $section = $field;

            if ($section->hasItems()) {
                foreach ($section->getItems() as $item) {
                    /** @var FieldTypeInterface $item */
                    $item->setOptions([
                        'group' => $section->getId()
                    ]);

                    $this->add($item, $section);
                }
            }

            return $this;
        }

        $field->setLocale($this->getLocale());
        $field->setPrefix($this->getPrefix());

        if (is_null($section)) {
            if ($this->repository()->hasGroup($field->getOption('group'))) {
                $section = $this->repository()->getGroup($field->getOption('group'));
            } else {
                $section = new Section($field->getOption('group'));
            }
            $section->addItem($field);
        }

        $this->repository()->addField($field, $section);

        return $this;
    }
755809
public function setToolSettings($settings = array())
    {

        $url = $this->getSetting('custom_system_setting_url');
        $service = new Service\ToolSettings($this, $url);
        $response = $service->set($settings);

        return $response;

    }
471564
public function findSectionOrCreate($name, Section $parent = null, $priority = 1)
    {
        if (is_null($parent)) {
            $parent = $this->getRootSection();
        }

        $section = $this->findSection($name, $parent);

        if (is_null($section)) {
            $section = $this->addSection($name, $parent, $priority);
        }

        return $section;
    }
1239425
public function create(
        $limit,
        $nameWords
    ) {
        $vocabularies = [];
        for ($i = 0; $i < $limit; $i++) {
            try {
                // Create a vocabulary.
                $vocabulary = $this->entityTypeManager->getStorage('taxonomy_vocabulary')->create(
                    [
                        'name' => $this->getRandom()->sentences(mt_rand(1, $nameWords), true),
                        'description' => $this->getRandom()->sentences(mt_rand(1, $nameWords)),
                        'vid' => Unicode::strtolower($this->getRandom()->name()),
                        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
                        'weight' => mt_rand(0, 10),
                    ]
                );
                $vocabulary->save();
                $vocabularies['success'][] = [
                    'vid' => $vocabulary->id(),
                    'vocabulary' => $vocabulary->get('name'),
                ];
            } catch (\Exception $error) {
                $vocabularies['error'][] = $error->getMessage();
            }
        }

        return $vocabularies;
    }
213389
public static function create_from_section($section) {
        $event = self::create([
            'context' => \context_course::instance($section->course),
            'objectid' => $section->id,
            'other' => ['sectionnum' => $section->section]
        ]);
        $event->add_record_snapshot('course_sections', $section);
        return $event;
    }
634104
public function create(array $settings = [])
    {
        $defaultDriver = $this->config->get('doctrine.cache.default', 'array');

        $configuration = $this->setup->createConfiguration(
            Arr::get($settings, 'dev', false),
            Arr::get($settings, 'proxies.path'),
            $this->cache->driver($defaultDriver)
        );

        $this->setMetadataDriver($settings, $configuration);

        $driver = $this->getConnectionDriver($settings);

        $connection = $this->connection->driver(
            $driver['driver'],
            $driver
        );

        if ($this->isMasterSlaveConfigured($driver)) {
            $this->hasValidMasterSlaveConfig($driver);
            $connection = (new MasterSlaveConnection($this->config, $connection))->resolve($driver);
        }

        $this->setNamingStrategy($settings, $configuration);
        $this->setCustomFunctions($configuration);
        $this->setCustomHydrationModes($configuration);
        $this->setCacheSettings($configuration);
        $this->configureProxies($settings, $configuration);
        $this->setCustomMappingDriverChain($settings, $configuration);
        $this->registerPaths($settings, $configuration);
        $this->setRepositoryFactory($settings, $configuration);

        $configuration->setDefaultRepositoryClassName(
            Arr::get($settings, 'repository', EntityRepository::class)
        );

        $configuration->setEntityListenerResolver($this->resolver);

        $manager = EntityManager::create(
            $connection,
            $configuration
        );

        $manager = $this->decorateManager($settings, $manager);

        $this->setLogger($manager, $configuration);
        $this->registerListeners($settings, $manager);
        $this->registerSubscribers($settings, $manager);
        $this->registerFilters($settings, $configuration, $manager);
        $this->registerMappingTypes($settings, $manager);

        return $manager;
    }
1343845
public function addSections($sections)
    {
        if (current($sections) instanceof Section) {
            foreach ($sections as $section) {
                $this->addSection($section);
            }
        } else {
            foreach ($sections as $key => $value) {
                $this->addSection($key, $value);
            }
        }
    }
204461
public function add($settings)
    {
        if (is_array($settings)) {
            $settings = new $this->settings($settings);
        }

        if (!$settings instanceof ResourceSettings) {
            throw new InvalidInstanceException('Settings is not a valid instance of ' . ResourceSettings::class);
        }

        $settings->hasRequiredSettings();

        $settings->theme = $this->getThemeToUse($settings);

        $addKey = sprintf('_added.%s.%s', $settings->theme->getName(), $settings->key);

        if ($this->resources->has($addKey)) {
            $this->logger->warning("Key already exists in Themer: '{$settings->key}'");
            return;
        }

        if ($this->addResource($settings)) {
            $this->resources->add($addKey, true);

            ++$this->order;
        }
    }
151206
protected function createOutput(Settings $settings) : string
    {
        return StrFormat::format(
            '{{scheme}}{{domain}}{{path}}{{query}}{{fragment}}',
            $this->parseUrlComponents($settings),
            new StrSettings([ 'removeUnparsed' => true ])
        );
    }
5785
public static function Section($Section, $Method = 'add') {
      $Section = array_fill_keys((array)$Section, TRUE);
      
      
      switch (strtolower($Method)) {
         case 'add':
            self::$_Section = array_merge(self::$_Section, $Section);
            break;
         case 'remove':
            self::$_Section = array_diff_key(self::$_Section, $Section);
            break;
         case 'set':
            self::$_Section = $Section;
            break;
         case 'get':
         default:
            return array_keys(self::$_Section);
      }
   }
630900
public function create($name, $identifier)
    {
        $section = new Section();

        $section->name = $name;
        $section->identifier = $identifier;

        $section->id = $this->sectionGateway->insertSection($name, $identifier);

        return $section;
    }
293161
public function addSection($name, Section $parent = null, $priority = 1)
    {
        if (is_null($parent)) {
            $parent = $this->getRootSection();
        }

        $section = new Section($this, [
            'name'     => $name,
            'priority' => $priority,
        ]);

        $parent->addPage($section);

        return $section;
    }
222099
protected function createSection(string $name, array $args) : SectionInterface {
        $className = $this->getSectionClassName($name);

        // aditional parameters
        $args[] = $this->authentication;
        $args[] = $this->client;
        $args[] = $this->throwsExceptions;
        $args[] = $this->baseUrl;

        return new $className(...$args);
    }
1317331
public function withSettings(array $settings): self
    {
        $this->settings = [];
        foreach ($settings as $name => $value) {
            $this->withSetting($name, $value);
        }

        return $this;
    }
1187862
protected function ovh(Settings $settings)
    {
        $client = new OVHClient([
            'username'  => $settings->get('ovhUsername'),
            'password'  => $settings->get('ovhPassword'),
            'tenantId'  => $settings->get('ovhTenantId'),
            'container' => $settings->get('ovhContainer'),
            'region'    => empty($settings->get('ovhRegion')) ? 'BHS1' : $settings->get('ovhRegion'),
        ]);

        return new Adapters\OVH(
            new OVHAdapter($client->getContainer())
        );
    }
631835
protected function createResourcesSection(array $resources = array())
    {
        $builder = new TreeBuilder();
        $node = $builder->root('resources');
        $node->addDefaultsIfNotSet();
        $resourceNodes = $node->children();

        foreach ($resources as $resource => $defaults) {
            $resourceNode = $resourceNodes
                ->arrayNode($resource)
                ->addDefaultsIfNotSet()
            ;

            $this->addClassesSection($resourceNode, $defaults['classes']);

            if (isset($defaults['options'])) {
                $this->createOptionsNode($resourceNode, $defaults['options']);
            }

            if (!isset($defaults['validation_groups'])) {
                $defaults['validation_groups'] = array(
                    'default' => array()
                );
            }

            $this->addValidationGroupsSection($resourceNode, $defaults['validation_groups']);

            if (isset($defaults['translation'])) {
                $this->createTranslationNode($resourceNode, $defaults['translation']);
            }
        }

        return $node;
    }