FilterObjectProperties::from()

Not yet in a tagged release

Description

FilterObjectProperties::from() - get an object's non-static properties

// remember to import first
use GanbaroDigital\MissingBits\ClassesAndObjects\FilterObjectProperties;

// our method signature
array FilterObjectProperties::from(object $target, $propTypes = ReflectionProperty::IS_PUBLIC);

Parameters

FilterObjectProperties::from() takes two parameters:

Return Values

FilterObjectProperties::from() returns an array of name / value pairs.

If the object has no non-static properties, FilterObjectProperties::from() returns an empty array.

Throws

FilterObjectProperties::from() throws an InvalidArgumentException if:

Notes