Psr2 Code Generator

PropertiesPart

Properties part.

For all models that can have properties

Tags
author

Thomas Gossmann

Table of Contents

$properties  : Map
clearProperties()  : $this
Clears all properties.
getProperties()  : Map
Returns a collection of properties.
getProperty()  : PhpProperty
Returns a property.
getPropertyNames()  : Set
Returns all property names.
hasProperty()  : bool
Checks whether a property exists.
hasPropertyByName()  : bool
Checks whether a property exists.
removeProperty()  : $this
Removes a property.
removePropertyByName()  : $this
Removes a property.
setProperties()  : $this
Sets a collection of properties.
setProperty()  : $this
Adds a property.
initProperties()  : void

Properties

Methods

clearProperties()

Clears all properties.

public clearProperties() : $this
Return values
$this

getProperties()

Returns a collection of properties.

public getProperties() : Map
Return values
Map

getProperty()

Returns a property.

public getProperty(string $name) : PhpProperty
Parameters
$name : string

property name

Tags
throws
InvalidArgumentException

If the property cannot be found

Return values
PhpProperty

getPropertyNames()

Returns all property names.

public getPropertyNames() : Set
Return values
Set

hasProperty()

Checks whether a property exists.

public hasProperty(PhpProperty $property) : bool
Parameters
$property : PhpProperty
Return values
bool

true if a property exists and false if not

hasPropertyByName()

Checks whether a property exists.

public hasPropertyByName(string $name) : bool
Parameters
$name : string

property name

Return values
bool

true if a property exists and false if not

removeProperty()

Removes a property.

public removeProperty(PhpProperty $property) : $this
Parameters
$property : PhpProperty
Tags
throws
InvalidArgumentException

If the property cannot be found

Return values
$this

removePropertyByName()

Removes a property.

public removePropertyByName(string $name) : $this
Parameters
$name : string

property name

Tags
throws
InvalidArgumentException

If the property cannot be found

Return values
$this

setProperties()

Sets a collection of properties.

public setProperties(array<string|int, PhpProperty$properties) : $this
Parameters
$properties : array<string|int, PhpProperty>
Return values
$this

initProperties()

private initProperties() : void
Return values
void

Search results