Helper for {@see addContentViewProvider()} and {@see addLocationViewProvider()}.

@param array $property
@param \eZ\Publish\Core\MVC\Symfony\View\ViewProvider $viewProvider
@param int $priority
494955
private function addViewProvider(&$property, $viewProvider, $priority)
    {
        $priority = (int)$priority;
        if (!isset($property[$priority])) {
            $property[$priority] = array();
        }

        $property[$priority][] = $viewProvider;
    }
1326463
public function addProperty($property, $content, $position = 100)
    {
        $attr = [
            'property' => $property,
            'content' => $content
        ];
        $this->add($attr, $position);
        return $this;
    }
218644
function setViewProvider(p){
            if (this.provider != p) {
                this.stopEditing(false);
                this.provider = p;
                delete this.nodes;
                this.nodes = {};
                this.vrp();
            }
            return this;
        }
955569
public function addView(string $view, array $data): void
    {
        $num = count($this->views) + 1;
        $key = '#' . $num . ' ' . $view;

        $this->views[$key] = $this->getDataFormatter()->formatVar($data);
    }
60562
public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(ComposerEvent::EVENT_HTML_BODY_PRE, [$this, 'injectLayoutViewModel']);
    }
504198
public function display($viewPath = null, $view = null)
	{
		if (!$viewPath) {
			$viewPath = $this->viewPath;
		}

		if (!$view) {
			$view = $this->view;
		}

		return (new AlertDisplay($this, $viewPath, $view))->display();
	}
241488
public function attach(EventManagerInterface $events, $priority = -500)
    {
        $this->listeners[] = $events->attach(
            AuthenticationEvent::AUTH,
            [
                $this,
                'onAuthentication'
            ],
            $priority
        );
    }
149350
private function parseWidgetPageTree(PropertyInterface $property, array $propInfo)
    {
        if (isset($propInfo['sourceName'])
            || ('pageTree' !== $property->getWidgetType())
        ) {
            return;
        }

        // If the foreign key not set, then use an standard as fallback.
        if (!isset($propInfo['foreignKey'])) {
            $propInfo['foreignKey'] = 'tl_page.title';
        }

        $property
            ->setExtra(
                \array_merge(
                    [
                        'sourceName' => \explode('.', $propInfo['foreignKey'])[0],
                        'idProperty' => 'id'
                    ],
                    (array) $property->getExtra()
                )
            );
    }
1311977
private function addFilterResAV($f, $priority = FilterChain::DEFAULT_PRIORITY) {
		$this->_filtersResAV->attach($f, $priority);
	}
301475
function _insertProviderSorted(array, provider, priority) {
        var index,
            prioritizedProvider = {
                priority: priority,
                provider: provider
            };

        for (index = 0; index < array.length; index++) {
            if (array[index].priority < priority) {
                break;
            }
        }

        array.splice(index, 0, prioritizedProvider);
    }
1319964
public function addAdaptMenu(MenuAdaptorInterface $adaptor, $priority = 0)
    {
        $this->adaptors[$priority][] = $adaptor;
        unset($this->sorted);
    }
72450
public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(ComposerEvent::EVENT_COMPOSE_POST, [$this, 'generateTextBody']);
    }
994645
public function addPath($namespace, $path, $priority = 5)
    {
        if ($path != '') {
            $path = rtrim($path, '/') . '/';
        }
        $namespace = '/' . trim($namespace, '/');
        
        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        $this->paths[$namespace][] = [
            'path' => $path,
            'priority' => $priority
        ];
        usort($this->paths[$namespace], ['Jivoo\Utilities', 'prioritySorter']);
    }
312728
public function listen($events, $listener, $priority=0)
    {
        return $this->getDistributor()->listen($events, $listener, $priority);
    }
138605
public function attach(EventManagerInterface $events, $priority = 1)
    {
        $this->listeners[] = $events->attach(ComposerEvent::EVENT_COMPOSE_PRE, [$this, 'setMessageEncoding']);
    }
321290
public function addListener(string $eventName, callable $listener, $priority = 0): MediatorInterface
    {
        $this->checkEventName($eventName);
        $priority = $this->getActualPriority($eventName, $priority);
        if (!(\array_key_exists($eventName, $this->listeners)
            && \array_key_exists($priority, $this->listeners[$eventName])
            && \in_array($listener, $this->listeners[$eventName][$priority], \true))
        ) {
            $this->listeners[$eventName][$priority][] = $listener;
        }
        return $this;
    }
495330
public function attach(EventManagerInterface $events, $priority = 1000)
    {
        if (PHP_SAPI === 'cli') {
            return;
        }

        $this->listeners[] = $events->getSharedManager()->attach(
            Application::class,
            MvcEvent::EVENT_ROUTE,
            [
                $this,
                'onRouteRemoveTrailingSlash'
            ],
            $priority
        );

        $this->listeners[] = $events->getSharedManager()->attach(
            Application::class,
            MvcEvent::EVENT_ROUTE,
            [
                $this,
                'onRouteNormalizeParameters'
            ],
            -$priority
        );
    }