Called to allow a class file to register xsd to class mapping
@param Array $xsd_entries Array of maps
@param string $compiled_taxonomy_name The name of the compiled taxonomy with which the $xsd_entries are associated
@return void
186210
public static function add_xsd_to_compiled_map_entries( $xsd_entries, $compiled_taxonomy_name )
	{
		if ( ! is_array( $xsd_entries ) || count( $xsd_entries ) === 0 ) return;

		global $compiled_taxonomy_name_prefix;
		if ( strpos( $compiled_taxonomy_name_prefix, '\\') !== false ) $compiled_taxonomy_name_prefix = str_replace( '\\', '/', $compiled_taxonomy_name_prefix );
		if ( strpos( $compiled_taxonomy_name_prefix, './') ) $compiled_taxonomy_name_prefix = XBRL::normalizePath( $compiled_taxonomy_name_prefix );
		XBRL::$xsd_to_compiled_map = array_merge( XBRL::$xsd_to_compiled_map, array_fill_keys( $xsd_entries, $compiled_taxonomy_name_prefix . $compiled_taxonomy_name ) );
	}
75568
protected function processPostSaveFilters(XMLElement $result, array $fields, Entry $entry = null)
    {
        /**
         * After saving entry from the front-end. This delegate will not force
         * the Events to terminate if it populates the `$filter_results` array.
         * Provided with references to this object, the `$_POST` data and also
         * the error array
         *
         * @delegate EventPostSaveFilter
         * @param string $context
         * '/frontend/'
         * @param integer $entry_id
         * @param array $fields
         * @param Entry $entry
         * @param Event $this
         * @param array $messages
         *  An associative array of array's which contain 4 values,
         *  the name of the filter (string), the status (boolean),
         *  the message (string) an optionally an associative array
         *  of additional attributes to add to the filter element.
         */
        Symphony::ExtensionManager()->notifyMembers('EventPostSaveFilter', '/frontend/', array(
            'entry_id' => $entry->get('id'),
            'fields' => $fields,
            'entry' => $entry,
            'event' => &$this,
            'messages' => &$this->filter_results
        ));

        if (is_array($this->filter_results) && !empty($this->filter_results)) {
            foreach ($this->filter_results as $fr) {
                list($name, $status, $message, $attributes) = $fr;

                $result->appendChild(
                    self::buildFilterElement($name, ($status ? 'passed' : 'failed'), $message, $attributes)
                );
            }
        }

        // Reset the filter results to prevent duplicates. RE: #2179
        $this->filter_results = array();
        return $result;
    }
671605
public function addElement($attrs)
    {
        if (!$this->getPrefix($attrs['type'])) {
            $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
        }
        $this->elements[$attrs['name']] = $attrs;
        $this->elements[$attrs['name']]['typeClass'] = 'element';

        $this->xdebug("addElement " . $attrs['name']);
        $this->appendDebug($this->varDump($this->elements[$attrs['name']]));
    }
151158
private void registerTypeMappings(
      TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) {
    Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping");
    Preconditions.checkNotNull(typeMappings, "Null type mappings");
    Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings");
    for (TypeMapping typeMapping : typeMappings) {
      for (Class<?> mappingClass : typeMapping.getAllClasses()) {
        QName classQName = typeMapping.getTypeQName(mappingClass);
        DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName);
        if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) {
          registryTypeMapping.register(
              mappingClass, classQName, (SerializerFactory) null, deserializer);
        }
      }
    }
  }
984240
@SuppressWarnings("unchecked")
    private void inheritNamespaces(SchemaImpl schema, Definition wsdl) {
        Map<String, String> wsdlNamespaces = wsdl.getNamespaces();
        
        for (Entry<String, String> nsEntry: wsdlNamespaces.entrySet()) {
            if (StringUtils.hasText(nsEntry.getKey())) {
                if (!schema.getElement().hasAttributeNS(WWW_W3_ORG_2000_XMLNS, nsEntry.getKey())) {
                    schema.getElement().setAttributeNS(WWW_W3_ORG_2000_XMLNS, "xmlns:" + nsEntry.getKey(), nsEntry.getValue());
                }
            } else { // handle default namespace
                if (!schema.getElement().hasAttribute("xmlns")) {
                    schema.getElement().setAttributeNS(WWW_W3_ORG_2000_XMLNS, "xmlns" + nsEntry.getKey(), nsEntry.getValue());
                }
            }
        }
    }
1301638
public function register($name = null, $entries = [], $attributes = [])
    {
        if (empty($name)) {
            $name = self::DEFAULT_MENU_NAME;
        }

        // check if menu's name does not exist
        $exists = false;

        foreach ($this->menus as $menu) {
            if ($menu->getName() == $name) {
                $exists = true;
            }
        }

        if (!$exists) {
            $this->menus->push(new MenuContainer($name, $entries, $attributes));
        } else {
            throw new MenuExistsException($name);
        }
    }
1232922
public function registerTaxonomies() {

		register_extended_taxonomy(
			'front-matter-type',
			'front-matter',
			[
				'meta_box' => 'dropdown',
				'meta_box_sanitize_cb' => 'taxonomy_meta_box_sanitize_cb_input',
				'capabilities' => [
					'manage_terms' => 'manage_sites',
					'edit_terms' => 'manage_sites',
					'delete_terms' => 'manage_sites',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);

		register_extended_taxonomy(
			'back-matter-type',
			'back-matter',
			[
				'meta_box' => 'dropdown',
				'meta_box_sanitize_cb' => 'taxonomy_meta_box_sanitize_cb_input',
				'capabilities' => [
					'manage_terms' => 'manage_sites',
					'edit_terms' => 'manage_sites',
					'delete_terms' => 'manage_sites',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);

		register_extended_taxonomy(
			'chapter-type',
			'chapter',
			[
				'meta_box' => 'dropdown',
				'meta_box_sanitize_cb' => 'taxonomy_meta_box_sanitize_cb_input',
				'capabilities' => [
					'manage_terms' => 'manage_sites',
					'edit_terms' => 'manage_sites',
					'delete_terms' => 'manage_sites',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);

		register_extended_taxonomy(
			'contributor',
			[ 'metadata', 'chapter', 'part', 'front-matter', 'back-matter' ],
			[
				'meta_box' => false,
				'hierarchical' => false,
				'capabilities' => [
					'manage_terms' => 'manage_options',
					'edit_terms' => 'manage_options',
					'delete_terms' => 'manage_options',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);

		register_extended_taxonomy(
			'license',
			[ 'metadata', 'chapter', 'part', 'front-matter', 'back-matter' ],
			[
				'meta_box' => false,
				'hierarchical' => false,
				'capabilities' => [
					'manage_terms' => 'manage_sites',
					'edit_terms' => 'manage_sites',
					'delete_terms' => 'manage_sites',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);

		register_extended_taxonomy(
			'glossary-type',
			'glossary',
			[
				'meta_box' => 'dropdown',
				'meta_box_sanitize_cb' => 'taxonomy_meta_box_sanitize_cb_input',
				'capabilities' => [
					'manage_terms' => 'manage_sites',
					'edit_terms' => 'manage_sites',
					'delete_terms' => 'manage_sites',
					'assign_terms' => 'edit_posts',
				],
				'show_in_rest' => true,
			]
		);
	}
1255164
private void addToCreateElements(String elementName) {
        HashMap<String, String> elementAttributes = new HashMap<>();

        elementAttributes.put(XsdAbstractElement.NAME_TAG, elementName);

        if (!createdElements.containsKey(getCleanName(elementName))){
            createdElements.put(getCleanName(elementName), new XsdElement(null, elementAttributes));
        }
    }
877583
protected void registerBindingConfigurationEntries(Iterable<BindingConfigurationEntry> bindings) {

        for (BindingConfigurationEntry nextBinding : bindings) {
        	try {
        		registerBindingConfigurationEntry(nextBinding);
        	} catch (IllegalStateException e) {
        		// Ignore this - it can happen when introspecting class mappings
        	}
        }
    }
1086427
protected function registerClassAliases(): void
	{
		$aliases = $this->config->get('application.class_aliases');

		if(!empty($aliases))
		{
			$aliasLoader = new AliasLoader($aliases);

			spl_autoload_register([$aliasLoader, 'load']);
		}
	}
130224
public function register( $selectors, $properties, $media_query = null ) {
		Style::register( $selectors, $properties, $media_query );
	}
468509
public function init()
    {
        $this->errors = array();
        $this->schemaFile = realpath(__DIR__ . '/../../../../../') . DIRECTORY_SEPARATOR . self::DEFAULT_XML_SCHEMA;
        $this->schemaFiles = array();
    }
923307
private function build(): void
    {
        $prefix = "<?xml version='1.0' encoding='UTF-8'?>" . $this->glue() . "<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>";
        $suffix = '</feed>';

        $xml = collect($this->filters)->map(function ($items) {
            return $this->buildEntry($items);
        })->implode($this->glue());

        $this->xml = collect([$prefix, $xml, $suffix])->implode($this->glue());

        if ($this->writeFile) {
            $this->filesystem->dumpFile($this->outputFile, $this->xml);
        }
    }
672645
public function autodiscover(): void
    {
        $entityMappings = [];
        foreach ($this->fileSystem->getEntityDirectories() as $entityDirectory) {
            $namespace = $this->namespaceDetector->detectFromDirectory($entityDirectory);
            if (! $namespace) {
                continue;
            }

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'annotation',
                'dir' => $entityDirectory->getRealPath(),
                'is_bundle' => false, // performance
            ];
        }

        $xmlNamespaces = [];

        $directoryByNamespace = $this->resolveDirectoryByNamespace($this->fileSystem->getEntityXmlFiles());
        foreach ($directoryByNamespace as $namespace => $directory) {
            if (in_array($namespace, $xmlNamespaces, true)) {
                continue;
            }

            $xmlNamespaces[] = $namespace;

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'xml',
                'dir' => $directory,
                'is_bundle' => false,
            ];
        }

        if (! count($entityMappings)) {
            return;
        }

        // @see https://symfony.com/doc/current/reference/configuration/doctrine.html#mapping-entities-outside-of-a-bundle
        $this->containerBuilder->prependExtensionConfig('doctrine', [
            'orm' => ['mappings' => $entityMappings],
        ]);
    }
1088335
protected function initializeElementRegister(ElementRegister $register)
    {
        $register->set('a', new AnchorElement());
        $register->set('admonition', new AdmonitionElement());
        $register->set('br', new BreakElement());
        $register->set('code', new CodeElement());
        $register->set('em', new EmphasisElement());
        $register->set('error', new AdmonitionElement('error'));
        $register->set('header', new HeaderElement());
        $register->set('h1', new HeaderElement(1));
        $register->set('h2', new HeaderElement(2));
        $register->set('h3', new HeaderElement(3));
        $register->set('h4', new HeaderElement(4));
        $register->set('h5', new HeaderElement(5));
        $register->set('h6', new HeaderElement(6));
        $register->set('hint', new AdmonitionElement('hint'));
        $register->set('img', new ImageElement());
        $register->set('include', new IncludeElement());
        $register->set('list', new ListElement());
        $register->set('note', new AdmonitionElement('note'));
        $register->set('p', new ParagraphElement());
        $register->set('spoiler', new AdmonitionElement('spoiler'));
        $register->set('strong', new StrongElement());
        $register->set('table', new TableElement());
        $register->set('td', new TableColumnElement());
        $register->set('th', new TableHeaderElement());
        $register->set('tr', new TableRowElement());
        $register->set('tip', new AdmonitionElement('tip'));
        $register->set('warning', new AdmonitionElement('warning'));
    }
705890
private function applySorting(ClassMetadata $metadata, string $className, array $sorting, string $alias): void
    {
        foreach ($sorting as $sort) {
            $customSort = $this->sortingTypeFactory->getCustomSorting($className, $sort['field']);
            if ($customSort) {
                $customSort($this->uniqueNameFactory, $metadata, $this->queryBuilder, $alias, $sort['order']);
            } else {
                $sortingField = $alias . '.' . $sort['field'];
                if ($sort['nullAsHighest'] ?? false) {
                    $expression = 'CASE WHEN ' . $sortingField . ' IS NULL THEN 1 ELSE 0 END';
                    $sortingField = $this->uniqueNameFactory->createAliasName('sorting');
                    $this->queryBuilder->addSelect($expression . ' AS HIDDEN ' . $sortingField);
                }

                $this->queryBuilder->addOrderBy($sortingField, $sort['order']);
            }
        }
    }
123881
public function setSchemaByName($schema_name = null)
    {
        if (! $schema_name) {
            $schema_name = $this->namespace;
        }
        if (strpos($schema_name, '.') === false) {
            $schema_name = (String) $this->db . '.' . $schema_name;
        }

        // Check formats
        if ($this->client->schema_format === 'php') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.php';
            if (file_exists($schema_file)) {
                $schema = include $schema_file;
                if (! is_array($schema)) {
                    throw new \Exception('Possible PHP syntax error in ' . $schema_file);
                }
            }
        } elseif ($this->client->schema_format === 'json') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.json';
            if (file_exists($schema_file)) {
                $json_string = file_get_contents($schema_file);
                $schema = json_decode($json_string, true);
                if (empty($schema)) {
                    throw new \Exception('Possible JSON parse error in ' . $schema_file);
                }
            }
        } else {
            throw new \Exception('Unknown schema format: ' . $this->client->schema_format);
        }

        // Assign Schema
        if (! empty($schema)) {
            $this->setSchema($schema);
        }

    }