identifier = $identifier; $this->renderable = $renderable; if (isset($options['condition']) && is_string($options['condition'])) { $this->condition = $options['condition']; } unset($options['condition'], $options['identifier'], $options['variants']); $this->options = $options; } /** * Apply the specified variant to this form element * regardless of their conditions */ public function apply(): void { $this->renderable->setOptions($this->options, true); $this->applied = true; } public function conditionMatches(Resolver $conditionResolver): bool { if (empty($this->condition)) { return false; } return (bool)$conditionResolver->evaluate($this->condition, ['renderable' => $this->renderable]); } public function getIdentifier(): string { return $this->identifier; } public function isApplied(): bool { return $this->applied; } }