{@inheritDoc}
@since 1.2.0
169511
@Override
    public ChainableEvent onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService) {
        this.onSuccessChains.add(new ChainLink()
                .onSuccess(linkChainIdentifier(onSuccessEvent), onSuccessEventService));
        return this;
    }
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();
        }
    }
150925
public function bind(InputInterface $input)
    {
        $this->validateInput($input);

        if (!$pattern = $input->getOption('grep')) {
            $this->filter = false;

            return;
        }

        if (!$this->stringIsRegex($pattern)) {
            $pattern = '/' . \preg_quote($pattern, '/') . '/';
        }

        if ($insensitive = $input->getOption('insensitive')) {
            $pattern .= 'i';
        }

        $this->validateRegex($pattern);

        $this->filter      = true;
        $this->pattern     = $pattern;
        $this->insensitive = $insensitive;
        $this->invert      = $input->getOption('invert');
    }
66607
public function invoke($object, $value)
    {
        if (null !== $value) {
            $this->method->invoke($object, $value);
        }
    }
679499
public function set($key, $value)
    {
        $this->assertElementIsOfType($value);

        $this->collection->set($key, $value);
    }
250500
public function set_value($value) {

        if (!empty($value) && !$this->field->isChecked()) {

            if (!$this->running_javascript()) {
                $this->field->check();
                return;
            }

            // Check it if it should be checked and it is not.
            $this->field->click();

            // Trigger the onchange event as triggered when 'checking' the checkbox.
            $this->trigger_on_change();

        } else if (empty($value) && $this->field->isChecked()) {

            if (!$this->running_javascript()) {
                $this->field->uncheck();
                return;
            }

            // Uncheck if it is checked and shouldn't.
            $this->field->click();

            // Trigger the onchange event as triggered when 'checking' the checkbox.
            $this->trigger_on_change();
        }
    }
392693
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $this->validateInput($input);

        if ($input->getOption('parameters')) {
            if (!$this->getContainer() instanceof Container) {
                return;
            }
            $parameters = $this->getContainer()->getParameterBag()->all();

            // Sort parameters alphabetically
            ksort($parameters);

            $this->outputParameters($output, $parameters);

            return;
        }

        $parameter = $input->getOption('parameter');
        if (null !== $parameter) {
            $output->write($this->formatParameter($this->getContainer()->getParameter($parameter)));

            return;
        }

        if ($input->getOption('tags')) {
            $this->outputTags($output, $input->getOption('show-private'));

            return;
        }

        $tag = $input->getOption('tag');
        $serviceIds = [];
        if ($this->getContainer() instanceof ContainerBuilder) {
            if (null !== $tag) {
                $serviceIds = array_keys($this->getContainer()->findTaggedServiceIds($tag));
            } else {
                $serviceIds = $this->getContainer()->getServiceIds();
            }
        }

        // sort so that it reads like an index of services
        asort($serviceIds);

        $name = $input->getArgument('name');
        if ($name) {
            $this->outputService($output, $name);
        } else {
            $this->outputServices($output, $serviceIds, $input->getOption('show-private'), $tag);
        }
    }
662223
public function setContext(array $context)
    {
        $this->clearContext();
        foreach ($context as $key => $value) {
            $this->setContextValue($key, $value);
        }
    }
401588
public function Bind()
	{
		if ( ! is_null( $this->_childs ) )
		{
			foreach ( $this->_childs as $node)
			{
				$node->Bind();
			}
		}
	}
480559
public function each($fn, $fieldFn = null)
	{
		$setBean = $this->getBean();
		$fields = $this->fields;
		$directives = $this->directives;

		if ($fieldFn === null) {
			foreach ( $setBean->{'ownSkemarecord' . $this->cleanBaseName . 'List'} as $id => $recordBean ) {
				$values          = [ ];

				$recordID = $recordBean->getID();

				foreach ( $fields as $cleanName => $field ) {
					$directive = Type::Directive($directives[ $cleanName ])
						->setValue( $recordBean->{$cleanName}, $recordID );

					switch ($this->keyType) {
						default:
						case self::$keysID:
							$key = $fields[$cleanName]->getBean()->getID();
							break;
						case self::$keysClean:
							$key = $cleanName;
							break;
						case self::$keysDirty:
							$key = $fields[$cleanName]->name;
							break;
					}

					$values[ $key ] = $directive;
				}

				$fn( $values, $recordID, $this, $recordBean, $this->keyType );
			}
		} else {
			foreach ( $setBean->{'ownSkemarecord' . $this->cleanBaseName . 'List'} as $id => $recordBean ) {
				$processedValues = [ ];

				foreach ( $fields as $cleanName => $field ) {
					$directive = Type::Directive($directives[ $cleanName ])
						->setValue( $recordBean->{$cleanName}, $recordBean->getID() );

					switch ($this->keyType) {
						default:
						case self::$keysID:
							$key = $fields[$cleanName]->getBean()->getID();
							break;
						case self::$keysClean:
							$key = $cleanName;
							break;
						case self::$keysDirty:
							$key = $fields[$cleanName]->name;
							break;
					}

					$processedValues[ $key ] = $fieldFn( $directive );
				}

				$fn( $processedValues );
			}
		}

		return $this;
	}
673766
public function validateBlocks(ElementInterface $element)
    {
        /** @var Element $element */
        /** @var SuperTableBlockQuery $value */
        $value = $element->getFieldValue($this->handle);

        foreach ($value->all() as $i => $block) {
            /** @var SuperTableBlock $block */
            if ($element->getScenario() === Element::SCENARIO_LIVE) {
                $block->setScenario(Element::SCENARIO_LIVE);
            }

            if (!$block->validate()) {
                foreach ($block->getErrors() as $attribute => $errors) {
                    $element->addErrors([
                        "{$this->handle}[{$i}].{$attribute}" => $errors,
                    ]);
                }
            }
        }
    }
434370
public function useObjectMapping($value)
    {
        if ($value === True) {
            $this->_useObjectMapping = true;
        } else {
            $this->_useObjectMapping = false;
        }
    }
791612
public function update($properties, $context = null, $maxbytes = null) {
        if ($properties->enableotheranswers) {
            $properties->response_editor = array_values($properties->response_editor);
            $properties->jumpto = array_values($properties->jumpto);
            $properties->score = array_values($properties->score);
            $wrongresponse = end($properties->response_editor);
            $wrongkey = key($properties->response_editor);
            $properties->answer_editor[$wrongkey] = LESSON_OTHER_ANSWERS;
        }
        parent::update($properties, $context, $maxbytes);
    }
1259568
public function has($id)
    {
        /** @var ContainerInterface $item */
        foreach ($this->list as $item) {
            if ($item->has($id)) {
                return true;
            }
        }

        return false;
    }
510670
public function initialize()
    {
        if (!$this->isInitialized()) {
            $this->getOriginalNodeNames();
            $fetchDepth = $this->fetchDepth > 0 ? $this->fetchDepth + 1 : -1;
            $childNodes = $this->getNode($fetchDepth)->getNodes($this->filter);
            $this->collection = new ArrayCollection($this->getChildren($childNodes));
            $this->initialized = self::INITIALIZED_FROM_PHPCR;
        }
    }
403276
public function remove($id)
    {
        $id   = $this->validateAndResolveId($id);
        $path = $this->items[$id][self::PATH];

        // remove item from hierarchy
        $this->hierarchy->remove($path);
        // remove item
        unset($this->items[$id]);
        $this->aliases->removeById($id);
        unset($this->blockThemes[$id]);
        // remove all children
        $pathLength    = count($path);
        $pathLastIndex = $pathLength - 1;
        $ids           = array_keys($this->items);
        foreach ($ids as $itemId) {
            $currentPath = $this->items[$itemId][self::PATH];
            if (count($currentPath) > $pathLength && $currentPath[$pathLastIndex] === $id) {
                unset($this->items[$itemId]);
                $this->aliases->removeById($itemId);
                unset($this->blockThemes[$itemId]);
            }
        }
    }
431455
public function edit($id)
    {
        if (!$this->request->is(['get', 'put'])) {
            throw new MethodNotAllowedException();
        }

        /** @var User $user */
        $user = $this->Users->getUserAndGroups($id);

        if ($this->request->is('put')) {
            $user = $this->Users->patchEntity($user, $this->request->data, ['associated' => 'Groups']);
            $userActivated = ($user->dirty('active') && $user->active);
            if ($userActivated) {
                // do not allow a user to be activated if his email address is not verified
                if (!$user->verified) {
                    $user->active = false;
                    $userActivated = false;
                } else {
                    $user->activate();
                }
            }
            $userDeactivated = ($user->dirty('active') && !$user->active);
            if ($userDeactivated) {
                // do not allow a user to deactivate his own account
                if ($user->id === Wasabi::user()->id) {
                    $user->active = true;
                    $userDeactivated = false;
                } else {
                    $user->deactivate();
                }
            }
            if ($this->Users->save($user, ['associated' => 'Groups'])) {
                if ($user->id === Wasabi::user()->id) {
                    $updateUser = $this->Users->get($user->id);
                    $updateUser->group_id = $this->Users->UsersGroups->getGroupIds($updateUser->id);
                    $this->Auth->setUser($updateUser->toArray());
                    Wasabi::user($updateUser);
                }
                if ($userActivated && $user->verified) {
                    $this->getMailer('Wasabi/Core.User')->send('activatedEmail', [$user]);
                }
                if ($userDeactivated && $user->verified) {
                    $this->getMailer('Wasabi/Core.User')->send('deactivatedEmail', [$user]);
                }
                $this->Flash->success(__d('pb', 'The user <strong>{0}</strong> has been updated.', $user->fullName()));
                $this->redirect($this->Filter->getBacklink(['action' => 'index'], $this->request));
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }

        $groups = $this->Users->Groups->find('list')->order('id ASC');

        // users that are no admin, may not select the admin group
        if (Wasabi::user()->hasAccessLevel(Permission::OWN)) {
            $groups->where(['id <>' => 1]);
        }

        $this->set([
            'user' => $user,
            'groups' => $groups,
            'languages' => Hash::map(Configure::read('languages.backend'), '{n}', function ($language) {
                return [
                    'value' => $language->id,
                    'text' => $language->name
                ];
            })
        ]);

        $this->render('add');
    }