WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

HashNode() WC 1.0

Represents a "<selector>#<id>" node.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$HashNode = new HashNode();
// use class methods

Методы

  1. __construct(NodeInterface $selector, $id)
  2. __toString()
  3. getId()
  4. getSelector()
  5. getSpecificity()

Код HashNode: woocommerce/vendor/symfony/css-selector/Node/HashNode.php WC 4.3.2

<?php
class HashNode extends AbstractNode
{
    private $selector;
    private $id;

    /**
     * @param string $id
     */
    public function __construct(NodeInterface $selector, $id)
    {
        $this->selector = $selector;
        $this->id = $id;
    }

    /**
     * @return NodeInterface
     */
    public function getSelector()
    {
        return $this->selector;
    }

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * {@inheritdoc}
     */
    public function getSpecificity()
    {
        return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
    }
}