Lazy_Collection::__get( string $property )

Allows accessing the collection methods using properties.

E.g. $collection->first is equivalent to $collection->first().


Parameters

$property

(string) (Required) The name of the property to access.


Top ↑

Return

(mixed|null) The return value of the collection corresponding method or null if the collection does not have that method.


Top ↑

Source

File: src/Tribe/Utils/Lazy_Collection.php

	public function __get( $property ) {
		if ( method_exists( $this, $property ) ) {
			return call_user_func( [ $this, $property ] );
		}

		return null;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.14 Introduced.