{@inheritDoc}
@since 1.3.0
325807
public void publish(final Notification notification) {
        LOGGER.debug("Dispatching notification: " + notification.getClass().toString());
        final ArrayList<Subscription> subscriptions = SUBSCRIPTION_MAP.get(notification.getClass());
        if (subscriptions == null) {
            LOGGER.debug("No subscribers to inform from notification: " + notification.getClass().getName());
            return;
        }
        for (final Subscription subscription: subscriptions) {
            if (subscription.getScope() != null && subscription.getGroup() != null && subscription.getLevel() != null) { // subscription was the most specific
                if (subscription.getScope().equals(notification.getScope()) && subscription.getGroup().equals(notification.getGroup()) && subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getGroup() != null && subscription.getLevel() != null) { // subscription was very specific
                if (subscription.getGroup().equals(notification.getGroup()) && subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getGroup() != null) { // subscription was somewhat specific
                if (subscription.getGroup().equals(notification.getGroup())) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getLevel() != null) { // subscription was somewhat specific
                if (subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else { // subscription was not specific
                alertSubscriber(notification, subscription.getSubscriber());
            }
        }
    }
214862
public function get($id = null)
    {
        if ($id == null)
            return false;
        $this->currentId        = $id;
        $this->currentKey       = $this->getRowKey($id);
        $this->setDocuments($this->getData()[$this->currentKey]);
        foreach ($this->documentEntries as $field => $value)
            $this->tableFields->{$field} = $value;
        return $this;
    }
512269
public function load(LoadingContext $context, ParentChildMap $map)
    {
        $filteredParentMap = new ParentChildMap();
        $parentItemMap     = new \SplObjectStorage();
        $relatedEntityMap  = $context->getIdentityMap($this->mapper->getObjectType());

        foreach ($map->getItems() as $item) {
            $relatedId = $item->getParent()->getColumn($this->foreignKeyToRelated);

            if ($relatedId === null) {
                $item->setChild(null);
            } elseif ($this->reference instanceof RelationIdentityReference) {
                $item->setChild((int)$relatedId);
            } elseif ($relatedEntityMap->has($relatedId)) {
                $item->setChild($relatedEntityMap->get($relatedId));
            } else {
                $filteredParentMap->add($item->getParent(), null);
                $parentItemMap[$item->getParent()] = $item;
            }
        }

        if ($filteredParentMap->getAllChildren()) {
            parent::load($context, $filteredParentMap);

            foreach ($filteredParentMap->getItems() as $item) {
                /** @var ParentChildItem $originalItem */
                $originalItem = $parentItemMap[$item->getParent()];
                $originalItem->setChild($item->getChild());
            }
        }
    }
624355
public static function remove( &$options = array(), $key )
    {
        $_originalValue = null;

        if ( static::contains( $options, $key ) )
        {
            $_cleanedKey = static::_cleanKey( $key );

            if ( is_array( $options ) )
            {
                if ( !isset( $options[$key] ) && isset( $options[$_cleanedKey] ) )
                {
                    $key = $_cleanedKey;
                }

                if ( isset( $options[$key] ) )
                {
                    $_originalValue = $options[$key];
                    unset( $options[$key] );
                }
            }
            else
            {
                if ( !isset( $options->{$key} ) && isset( $options->{$_cleanedKey} ) )
                {
                    $key = $_cleanedKey;
                }

                if ( isset( $options->{$key} ) )
                {
                    $_originalValue = $options->{$key};
                }

                unset( $options->{$key} );
            }
        }

        return $_originalValue;
    }
801999
public function func()
    {
        $args = func_get_args();
        $fns  = explode('|', array_shift($args));
        $res  = null;

        foreach (array_reverse($fns) as $fnc) {
            if (!isset($this->functions[$fnc])) {
                throw new \RuntimeException(sprintf('Template function "%s" does not exist.', $fnc));
            }

            $res = $this->functions[$fnc]->call($args);

            if (!$this->functions[$fnc]->getOption('is_safe_html')) {
                $res = $this->escape($res);
            }

            $args = [$res];
        }

        return $res;
    }
706343
public function delete(EntityDefinition $definition, array $ids, WriteContext $writeContext): DeleteResult
    {
        $this->validateWriteInput($ids);

        $commandQueue = new WriteCommandQueue();

        $fields = $definition->getPrimaryKeys();

        $resolved = [];
        foreach ($ids as $raw) {
            $mapped = [];

            /** @var Field $field */
            foreach ($fields as $field) {
                if (!($field instanceof StorageAware)) {
                    continue;
                }

                if (array_key_exists($field->getPropertyName(), $raw)) {
                    $mapped[$field->getStorageName()] = $raw[$field->getPropertyName()];
                    continue;
                }

                if ($field instanceof ReferenceVersionField) {
                    $mapped[$field->getStorageName()] = $writeContext->getContext()->getVersionId();
                    continue;
                }

                if ($field instanceof VersionField) {
                    $mapped[$field->getStorageName()] = $writeContext->getContext()->getVersionId();
                    continue;
                }

                $fieldKeys = $fields
                    ->filter(function (Field $field) {
                        return !$field instanceof VersionField && !$field instanceof ReferenceVersionField;
                    })
                    ->map(function (Field $field) {
                        return $field->getPropertyName();
                    });

                throw new IncompletePrimaryKeyException($fieldKeys);
            }

            $resolved[] = $mapped;
        }

        if (!$definition instanceof MappingEntityDefinition) {
            $restrictions = $this->foreignKeyResolver->getAffectedDeleteRestrictions($definition, $resolved, $writeContext->getContext());

            if (!empty($restrictions)) {
                $restrictions = array_map(function ($restriction) {
                    return new RestrictDeleteViolation($restriction['pk'], $restriction['restrictions']);
                }, $restrictions);

                throw new RestrictDeleteViolationException($definition, $restrictions, $this->registry);
            }
        }

        $cascades = [];
        if (!$definition instanceof MappingEntityDefinition) {
            $cascadeDeletes = $this->foreignKeyResolver->getAffectedDeletes($definition, $resolved, $writeContext->getContext());

            $cascadeDeletes = array_column($cascadeDeletes, 'restrictions');
            foreach ($cascadeDeletes as $cascadeDelete) {
                $cascades = array_merge_recursive($cascades, $cascadeDelete);
            }

            foreach ($cascades as $affectedDefinitionClass => &$cascade) {
                $affectedDefinition = $this->registry->get($affectedDefinitionClass);

                $cascade = array_map(function ($key) use ($affectedDefinition) {
                    $payload = $key;

                    if (!\is_array($key)) {
                        $payload = ['id' => $key];
                    }

                    return new EntityWriteResult($key, $payload, $affectedDefinition, null);
                }, $cascade);
            }
        }

        $skipped = [];
        foreach ($resolved as $mapped) {
            $mappedBytes = array_map(function ($id) {
                return Uuid::fromHexToBytes($id);
            }, $mapped);

            $existence = $this->gateway->getExistence($definition, $mappedBytes, [], $commandQueue);

            if (!$existence->exists()) {
                $skipped[$definition->getClass()][] = new EntityWriteResult($mapped, $mapped, $definition, $existence);
                continue;
            }

            $commandQueue->add(
                $definition,
                new DeleteCommand(
                    $definition,
                    $mappedBytes,
                    $existence
                )
            );
        }

        $writeContext->setLanguages($this->languageLoader->loadLanguages());
        $identifiers = $this->getWriteResults($commandQueue);
        $this->gateway->execute($commandQueue->getCommandsInOrder(), $writeContext);

        return new DeleteResult(
            array_merge_recursive($identifiers, $cascades),
            $skipped
        );
    }
157978
public function persist(PersistenceContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parentRows */
        $parentRows = [];
        /** @var object[] $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            $parentRow = $item->getParent();

            $hasChild = (bool)$item->getChild();
            if ($hasChild) {
                $parentRows[$key] = $parentRow;
                $children[$key]   = $item->getChild();
            }

            if ($this->objectIssetColumnName && !$this->isWithinValueObject) {
                $parentRow->setColumn($this->objectIssetColumnName, $hasChild);
            }
        }

        $this->disableLazyLoadingForRelations(function () use ($context, $children, $parentRows) {
            $this->mapper->persistAllToRows($context, $children, $parentRows);
        });
    }
653676
private function validateFieldsExistence(ObjectDefinition $object, InterfaceDefinition $interface): void
    {
        foreach ($interface->getFields() as $field) {
            $this->getCallStack()->push($field);

            $exists = $object->hasField($field->getName());

            if (! $exists) {
                $this->throwFieldNotDefined($interface, $object, $field);
            }

            $this->validateFieldCompatibility($field, $object->getField($field->getName()));

            $this->getCallStack()->pop();
        }
    }
600982
public function execute()
    {
        foreach (array_unique($this->bootstrappers->all()) as $class) {
            $bootstrapper = $this->create($class);

            if (!method_exists($bootstrapper, 'run')) {
                throw new \RuntimeException("$class must have run() method");
            }

            $bootstrapper->run();
        }
    }
906555
public function offset( $offset ) {
		$this->offset = $offset;
		if ( false === starts_with( $offset . '', ':' ) ) {
			$this->offset = (int) $offset;
		}
	}
900002
public function __isset($key)
    {
        if (!isset($this->_object) && $key == $this->_property) {
            return isset($this->_value);
        }

        return parent::__isset($key);
    }
432009
public function execute()
    {
        $db = $this->dbHandle;
        $db->/** @scrutinizer ignore-call */
        sqliteCreateFunction('log', 'log', 1);
        $sql = '
		INSERT INTO inverse_document_frequency (term, inverseDocumentFrequency)
		SELECT DISTINCT term, (1+(log(:documentCount / COUNT(documentPath) + 1))) AS inverseDocumentFrequency
					  FROM term_count
				  GROUP BY term
		';

        if (!$stmt = $db->prepare($sql)) {
            $errorInfo = $db->errorInfo();
            $errorMsg = $errorInfo[2];
            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
        }
        $stmt->bindValue(':documentCount', $this->documentCount);
        $result = $stmt->execute();
        if ($result === false) {
            $errorInfo = $db->errorInfo();
            $errorMsg = $errorInfo[2];
            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
        }
    }
1071766
public function actionOptions()
    {
        if ($this->getContext()->getInput()->get('id')) {
            $options = $this->resourceOptions;
        } else {
            $options = $this->collectionOptions;
        }
        $this->outputOptions($options);
    }
434343
public function setId( $key )
	{
		if( $key !== null )
		{
			$this->setCode($key);
			$this->_values['id'] = $this->_values['code'];
			$this->_modified = false;
		}
		else
		{
			$this->_values['id'] = null;
			$this->_modified = true;
		}
	}
128020
public function bind($bindObject) {
        // Loop over object and set property value
        foreach ($bindObject as $key => $value) {
            ObjectUtils::setNestedObjectProperty($value, $this, $key);
        }
    }
503861
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        try {
            $this->doExecute($input, $output);
        } catch (\Exception $e) {
            $this->writeException($e);
        }
    }
1306724
public function initialize()
    {
        if (null !== $this->collection) {
            return;
        }

        if (empty($this->dbOptions['database'])) {
            throw new \RuntimeException('The option "database" must be set');
        }
        if (empty($this->dbOptions['collection'])) {
            throw new \RuntimeException('The option "collection" must be set');
        }

        $this->collection = $this
            ->mongo
            ->selectDB($this->dbOptions['database'])
            ->selectCollection($this->dbOptions['collection']);
    }