Form_Category::__set( string $property, mixed $value )

Magic setter.

Description

Sets a property value.

See also

Parameters

$property

(string) (Required) Property to set.

$value

(mixed) (Required) Property value.

Source

File: src/db-objects/form-categories/form-category.php

	public function __set( $property, $value ) {
		$found = false;
		$changed = false;

		switch ( $property ) {
			case 'id':
			case 'count':
				return;
			case 'title':
				$found = true;
				if ( $this->original->name !== $value ) {
					$this->original->name = $value;
					$changed = true;
				}
				break;
		}

		if ( $found ) {
			if ( $changed && ! in_array( $property, $this->pending_properties, true ) ) {
				$this->pending_properties[] = $property;
			}

			return;
		}

		parent::__set( $property, $value );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.