Submission::__get( string $property )

Magic getter.

Description

Returns a property value.

See also

Parameters

$property

(string) (Required) Property to get.

Return

(mixed) Property value, or null if property is not set.

Source

File: src/db-objects/submissions/submission.php

	public function __get( $property ) {
		if ( 'values' === $property ) {
			if ( is_array( $this->values ) ) {
				return $this->values;
			}

			return $this->get_submission_values_data();
		}

		if ( preg_match( '/^element_([0-9]+)_([a-z_]+)_value$/U', $property, $matches ) ) {
			$values = $this->get_element_values_data();

			if ( isset( $values[ $matches[1] ] ) && isset( $values[ $matches[1] ][ $matches[2] ] ) ) {
				return $values[ $matches[1] ][ $matches[2] ];
			}

			return null;
		}

		return parent::__get( $property );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.