Checks whether a specific element is evaluatable.
Description
An evaluatable element must implement the Choice_Element_Type_Interface interface.
See also
Parameters
- $element_id
-
(int) (Required) Element ID to check.
Return
(bool) True if the element is evaluatable, false otherwise.
Source
File: src/modules/evaluators/evaluator.php
protected function is_element_evaluatable( $element_id ) { if ( ! isset( $this->evaluatable_elements[ $element_id ] ) ) { $elements = $this->module->manager()->forms()->get_child_manager( 'containers' )->get_child_manager( 'elements' ); $element = $elements->get( $element_id ); if ( ! $element ) { $this->evaluatable_elements[ $element_id ] = false; } else { $element_type = $element->get_element_type(); if ( ! $element_type || ! is_a( $element_type, Choice_Element_Type_Interface::class ) ) { $this->evaluatable_elements[ $element_id ] = false; } else { $this->evaluatable_elements[ $element_id ] = true; } } } return $this->evaluatable_elements[ $element_id ]; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |