Combines {@link self::applySeMeta()} and {@link self::applyN2nLocaleMeta()}

@param string $seTitle See {@link self::applySeMeta()}
@param string $titleSeparator See {@link self::applySeMeta()}
328776
public function applyMeta(string $seTitle = null, string $titleSeparator = self::DEFAULT_TITLE_SEPARATOR) {
		$this->applySeMeta($seTitle, $titleSeparator);
		$this->applyN2nLocaleMeta();
	}
1206906
public function setMetaTitle(string $str): PdfInterface
    {
        $this->setProperty('metaTitle', $str);
        $this->mpdf->SetTitle($this->metaTitle);

        return $this;
    }
1031396
public function setCacheTtl($cacheTtl = NULL)
    {
        $this->cacheTtl = $cacheTtl;
        $this->debug->debug(__FUNCTION__, 'setCacheTtl: ', $this->cacheTtl);
    }
1295331
public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
		if ( empty( $settings['smartQuotes'] ) ) {
			return;
		}

		// Need to get context of adjacent characters outside adjacent inline tags or HTML comment
		// if we have adjacent characters add them to the text.
		$previous_character = DOM::get_prev_chr( $textnode );
		$next_character     = DOM::get_next_chr( $textnode );
		$node_data          = "{$previous_character}{$textnode->data}{$next_character}";
		$f                  = Strings::functions( $node_data );

		// Various special characters and regular expressions.
		$double = $settings->primary_quote_style();
		$single = $settings->secondary_quote_style();

		// Mark quotes to ensure proper removal of replaced adjacent characters.
		$double_open  = RE::ESCAPE_MARKER . $double->open() . RE::ESCAPE_MARKER;
		$double_close = RE::ESCAPE_MARKER . $double->close() . RE::ESCAPE_MARKER;
		$single_open  = RE::ESCAPE_MARKER . $single->open() . RE::ESCAPE_MARKER;
		$single_close = RE::ESCAPE_MARKER . $single->close() . RE::ESCAPE_MARKER;

		if ( $double != $this->cached_primary_quotes || $single != $this->cached_secondary_quotes ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- object value comparison.
			$this->update_smart_quotes_brackets( $double_open, $double_close, $single_open, $single_close );
			$this->cached_primary_quotes   = $double;
			$this->cached_secondary_quotes = $single;
		}

		// Handle excpetions first.
		$node_data = \str_replace( $settings['smartQuotesExceptions']['patterns'], $settings['smartQuotesExceptions']['replacements'], $node_data );

		// Before primes, handle quoted numbers (and quotes ending in numbers).
		$node_data = \preg_replace(
			[
				self::SINGLE_QUOTED_NUMBERS . $f['u'],
				self::DOUBLE_QUOTED_NUMBERS . $f['u'],
			],
			[
				"{$single_open}\$1{$single_close}",
				"{$double_open}\$1{$double_close}",
			],
			$node_data
		);

		// Guillemets.
		$node_data = \str_replace( [ '<<', '>>' ], [ U::GUILLEMET_OPEN, U::GUILLEMET_CLOSE ],  $node_data );

		// Primes.
		$node_data = \preg_replace(
			[
				self::SINGLE_DOUBLE_PRIME . $f['u'],
				self::DOUBLE_PRIME . $f['u'], // should not interfere with regular quote matching.
				self::SINGLE_PRIME . $f['u'],
			],
			[
				'$1' . U::SINGLE_PRIME . '$2$3' . U::DOUBLE_PRIME, // @codeCoverageIgnoreStart
				'$1' . U::DOUBLE_PRIME,
				'$1' . U::SINGLE_PRIME, // @codeCoverageIgnoreEnd
			],
			$node_data
		);

		// Backticks & comma quotes.
		$node_data = \str_replace(
			[ '``', '`', "''", ',,' ],
			[ $double_open, $single_open, $double_close, U::DOUBLE_LOW_9_QUOTE ],
			$node_data
		);
		$node_data = \preg_replace( self::COMMA_QUOTE . $f['u'], U::SINGLE_LOW_9_QUOTE, $node_data ); // like _,¿hola?'_.

		// Apostrophes.
		$node_data = \preg_replace(
			[ self::APOSTROPHE_WORDS . $f['u'], self::APOSTROPHE_DECADES . $f['u'] ],
			[ U::APOSTROPHE, U::APOSTROPHE . '$1' ],
			$node_data
		);

		// Quotes.
		$node_data = \str_replace( $this->brackets_matches, $this->brackets_replacements, $node_data );
		$node_data = \preg_replace(
			[
				self::SINGLE_QUOTE_OPEN . $f['u'],
				self::SINGLE_QUOTE_CLOSE . $f['u'],
				self::DOUBLE_QUOTE_OPEN . $f['u'],
				self::DOUBLE_QUOTE_CLOSE . $f['u'],
			],
			[
				$single_open,
				$single_close,
				$double_open,
				$double_close,
			],
			$node_data
		);

		// Quote catch-alls - assume left over quotes are closing - as this is often the most complicated position, thus most likely to be missed.
		$node_data = \str_replace( [ "'", '"' ], [ $single_close, $double_close ], $node_data );

		// Add a thin non-breaking space between secondary and primary quotes.
		$no_break  = $settings->no_break_narrow_space();
		$node_data = \str_replace(
			[ "{$double_open}{$single_open}", "{$single_close}{$double_close}" ],
			[ "{$double_open}{$no_break}{$single_open}", "{$single_close}{$no_break}{$double_close}" ],
			$node_data
		);

		// Check if adjacent characters where replaced with multi-byte replacements.
		$quotes          = [
			$double_open,
			$double_close,
			$single_open,
			$single_close,
			U::GUILLEMET_OPEN, // @codeCoverageIgnoreStart
			U::GUILLEMET_CLOSE,
			U::DOUBLE_PRIME,
			U::SINGLE_PRIME,
			U::APOSTROPHE,
			U::DOUBLE_LOW_9_QUOTE,
			U::SINGLE_LOW_9_QUOTE, // @codeCoverageIgnoreEnd
		];
		$previous_length = self::calc_adjacent_length( $f['strlen']( $previous_character ), $previous_character, $node_data, $quotes, $f['substr'], $f['strlen'], false );
		$next_length     = self::calc_adjacent_length( $f['strlen']( $next_character ), $next_character, $node_data, $quotes, $f['substr'], $f['strlen'], true );

		// If we have adjacent characters, remove them from the text.
		$node_data = self::remove_adjacent_characters( $node_data, $f['strlen'], $f['substr'], $previous_length, $next_length );

		// Remove the escape markers and restore the text to the actual node.
		$textnode->data = \str_replace( RE::ESCAPE_MARKER, '', $node_data );
	}
1287730
protected function _setTpl($tpl)
    {
        $this->_tpl = $tpl;

        if ($tpl === true) {
            $this->_tpl = self::TPL_WRAP;
        }

        if ($tpl === false) {
            $this->_tpl = self::TPL_DEFAULT;
        }
    }
27469
public function setCedente(array $cedente = [])
    {
        $this->datos['Cesion']['DocumentoCesion']['Cedente'] = \sasco\LibreDTE\Arreglo::mergeRecursiveDistinct([
            'RUT' => $this->Encabezado['Emisor']['RUTEmisor'],
            'RazonSocial' => $this->Encabezado['Emisor']['RznSoc'],
            'Direccion' => $this->Encabezado['Emisor']['DirOrigen'].', '.$this->Encabezado['Emisor']['CmnaOrigen'],
            'eMail' => !empty($this->Encabezado['Emisor']['CorreoEmisor']) ? $this->Encabezado['Emisor']['CorreoEmisor'] : false,
            'RUTAutorizado' => [
                'RUT' => false,
                'Nombre' => false,
            ],
            'DeclaracionJurada' => false,
        ], $cedente);
        if (!$this->datos['Cesion']['DocumentoCesion']['Cedente']['DeclaracionJurada']) {
            $this->datos['Cesion']['DocumentoCesion']['Cedente']['DeclaracionJurada'] = mb_substr(str_replace(
                [
                    '{usuario_nombre}',
                    '{usuario_run}',
                    '{emisor_razon_social}',
                    '{emisor_rut}',
                    '{cesionario_razon_social}',
                    '{cesionario_rut}',
                    '{receptor_razon_social}',
                    '{receptor_rut}',
                ],
                [
                    $this->datos['Cesion']['DocumentoCesion']['Cedente']['RUTAutorizado']['Nombre'],
                    $this->datos['Cesion']['DocumentoCesion']['Cedente']['RUTAutorizado']['RUT'],
                    $this->datos['Cesion']['DocumentoCesion']['Cedente']['RazonSocial'],
                    $this->datos['Cesion']['DocumentoCesion']['Cedente']['RUT'],
                    $this->datos['Cesion']['DocumentoCesion']['Cesionario']['RazonSocial'],
                    $this->datos['Cesion']['DocumentoCesion']['Cesionario']['RUT'],
                    $this->Encabezado['Receptor']['RznSocRecep'],
                    $this->Encabezado['Receptor']['RUTRecep'],
                ],
                $this->declaracion
            ), 0, 512);
        }
    }
902047
public static function set(string $name, string $title = null): self
    {
        $td = new static($name);
        $td->column = $name;
        $td->title = is_null($title) ? title_case($name) : $title;

        return $td;
    }
1028243
private function parseAuthnContext(DOMElement $authnStatementEl) : void
    {
        // Get the AuthnContext element
        /** @var \DOMElement[] $authnContexts */
        $authnContexts = Utils::xpQuery($authnStatementEl, './saml_assertion:AuthnContext');
        if (count($authnContexts) > 1) {
            throw new \Exception('More than one <saml:AuthnContext> in <saml:AuthnStatement>.');
        } elseif (empty($authnContexts)) {
            throw new \Exception('Missing required <saml:AuthnContext> in <saml:AuthnStatement>.');
        }
        $authnContextEl = $authnContexts[0];

        // Get the AuthnContextDeclRef (if available)
        /** @var \DOMElement[] $authnContextDeclRefs */
        $authnContextDeclRefs = Utils::xpQuery($authnContextEl, './saml_assertion:AuthnContextDeclRef');
        if (count($authnContextDeclRefs) > 1) {
            throw new \Exception(
                'More than one <saml:AuthnContextDeclRef> found?'
            );
        } elseif (count($authnContextDeclRefs) === 1) {
            $this->setAuthnContextDeclRef(trim($authnContextDeclRefs[0]->textContent));
        }

        // Get the AuthnContextDecl (if available)
        /** @var \DOMElement[] $authnContextDecls */
        $authnContextDecls = Utils::xpQuery($authnContextEl, './saml_assertion:AuthnContextDecl');
        if (count($authnContextDecls) > 1) {
            throw new \Exception(
                'More than one <saml:AuthnContextDecl> found?'
            );
        } elseif (count($authnContextDecls) === 1) {
            $this->setAuthnContextDecl(new Chunk($authnContextDecls[0]));
        }

        // Get the AuthnContextClassRef (if available)
        /** @var \DOMElement[] $authnContextClassRefs */
        $authnContextClassRefs = Utils::xpQuery($authnContextEl, './saml_assertion:AuthnContextClassRef');
        if (count($authnContextClassRefs) > 1) {
            throw new \Exception('More than one <saml:AuthnContextClassRef> in <saml:AuthnContext>.');
        } elseif (count($authnContextClassRefs) === 1) {
            $this->setAuthnContextClassRef(trim($authnContextClassRefs[0]->textContent));
        }

        // Constraint from XSD: MUST have one of the three
        if (empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef)) {
            throw new \Exception(
                'Missing either <saml:AuthnContextClassRef> or <saml:AuthnContextDeclRef> or <saml:AuthnContextDecl>'
            );
        }

        $this->AuthenticatingAuthority = Utils::extractStrings(
            $authnContextEl,
            Constants::NS_SAML,
            'AuthenticatingAuthority'
        );
    }
884017
public function setTabTitle()
    {
        $size = $this->getCollection()->count();
        $title = $size
            ? __('Related Posts %1', '<span class="counter">' . $size . '</span>')
            : '';
        $this->setTitle($title);
    }
1325218
public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
		if ( empty( $settings['smartOrdinalSuffix'] ) ) {
			return;
		}

		// Always match Arabic numbers.
		$patterns = [ self::RE_ARABIC_ORDINALS ];

		// Only match Roman numbers if explicitely enabled.
		if ( ! empty( $settings['smartOrdinalSuffixRomanNumerals'] ) ) {
			$patterns[] = self::RE_ROMAN_ORDINALS;
		}

		$textnode->data = \preg_replace( $patterns, $this->replacement, $textnode->data );
	}
1287394
public function setTotalsTitle($field, $title = 'Total: %s row%s')
    {
        $this->totals_title_field = $field;
        $this->totals_title = $title;

        return $this;
    }
1305831
protected function _setLineNumber($lineNumber)
    {
        if ($lineNumber !== null) {
            try {
                $lineNumber = $this->_normalizeInt($lineNumber);
            } catch (RootException $e) {
                throw $this->_createInvalidArgumentException($this->__('Invalid line number'), null, $e, $lineNumber);
            }

            if ($lineNumber < 1) {
                throw $this->_createInvalidArgumentException($this->__('Line number must be positive'), null, null, $lineNumber);
            }
        }

        $this->lineNumber = $lineNumber;
    }
418628
public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
		if ( empty( $settings['smartFractions'] ) && empty( $settings['fractionSpacing'] ) ) {
			return;
		}

		// Cache textnode content.
		$node_data = $textnode->data;

		if ( ! empty( $settings['fractionSpacing'] ) && ! empty( $settings['smartFractions'] ) ) {
			$node_data = \preg_replace( self::SPACING, '$1' . $settings->no_break_narrow_space() . '$2', $node_data );
		} elseif ( ! empty( $settings['fractionSpacing'] ) && empty( $settings['smartFractions'] ) ) {
			$node_data = \preg_replace( self::SPACING, '$1' . U::NO_BREAK_SPACE . '$2', $node_data );
		}

		if ( ! empty( $settings['smartFractions'] ) ) {
			// Escape sequences we don't want fractionified.
			$node_data = \preg_replace( [ $this->escape_consecutive_years, self::ESCAPE_DATE_MM_YYYY ], '$1' . RE::ESCAPE_MARKER . '$2$3', $node_data );

			// Replace fractions.
			$node_data = \preg_replace( self::FRACTION_MATCHING, $this->replacement, $node_data );

			// Unescape escaped sequences.
			$node_data = \str_replace( RE::ESCAPE_MARKER, '', $node_data );
		}

		// Restore textnode content.
		$textnode->data = $node_data;
	}
891074
public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
		if ( empty( $settings[ $this->settings_switch ] ) ) {
			return;
		}

		$textnode->data = \preg_replace( $this->regex, $this->replacement, $textnode->data );
	}
1361393
public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
		if ( empty( $settings['dashSpacing'] ) ) {
			return;
		}

		// Various special characters and regular expressions.
		$s = $settings->dash_style();

		if ( $s != $this->cached_dash_style ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- object value comparison.
			$this->update_dash_spacing_regex( $s->parenthetical_dash(), $s->parenthetical_space(), $s->interval_dash(), $s->interval_space() );
			$this->cached_dash_style = $s;
		}

		// Cache $textnode->data for this fix.
		$node_data = $textnode->data;

		$node_data = \preg_replace( self::EM_DASH_SPACING,             $this->em_dash_replacement,            $node_data );
		$node_data = \preg_replace( $this->parenthetical_dash_spacing, $this->parenthetical_dash_replacement, $node_data );
		$node_data = \preg_replace( $this->interval_dash_spacing,      $this->interval_dash_replacement,      $node_data );

		// Restore textnode content.
		$textnode->data = $node_data;
	}
645026
private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element): void
    {
        foreach ($metadata->xmlNamespaces as $prefix => $uri) {
            $attribute = 'xmlns';
            if ('' !== $prefix) {
                $attribute .= ':' . $prefix;
            } elseif ($element->namespaceURI === $uri) {
                continue;
            }
            $element->setAttributeNS('http://www.w3.org/2000/xmlns/', $attribute, $uri);
        }
    }
1338296
public function addMultiple(ChildSkill $l)
    {
        if ($this->collMultiples === null) {
            $this->initMultiples();
            $this->collMultiplesPartial = true;
        }

        if (!$this->collMultiples->contains($l)) {
            $this->doAddMultiple($l);
        }

        return $this;
    }