trait PropertiesPart

Properties part

For all models that can have properties

Methods

$this
setProperties(array $properties)

Sets a collection of properties

$this
setProperty(PhpProperty $property)

Adds a property

$this
removeProperty(PhpProperty|string $nameOrProperty)

Removes a property

bool
hasProperty(PhpProperty|string $nameOrProperty)

Checks whether a property exists

getProperty(string $nameOrProperty)

Returns a property

Map
getProperties()

Returns a collection of properties

Set
getPropertyNames()

Returns all property names

$this
clearProperties()

Clears all properties

Details

at line line 29
$this setProperties(array $properties)

Sets a collection of properties

Parameters

array $properties

Return Value

$this

at line line 49
$this setProperty(PhpProperty $property)

Adds a property

Parameters

PhpProperty $property

Return Value

$this

at line line 63
$this removeProperty(PhpProperty|string $nameOrProperty)

Removes a property

Parameters

PhpProperty|string $nameOrProperty property name or instance

Return Value

$this

Exceptions

InvalidArgumentException If the property cannot be found

at line line 84
bool hasProperty(PhpProperty|string $nameOrProperty)

Checks whether a property exists

Parameters

PhpProperty|string $nameOrProperty property name or instance

Return Value

bool true if a property exists and false if not

at line line 99
PhpProperty getProperty(string $nameOrProperty)

Returns a property

Parameters

string $nameOrProperty property name

Return Value

PhpProperty

Exceptions

InvalidArgumentException If the property cannot be found

at line line 116
Map getProperties()

Returns a collection of properties

Return Value

Map

at line line 125
Set getPropertyNames()

Returns all property names

Return Value

Set

at line line 134
$this clearProperties()

Clears all properties

Return Value

$this