PHP Class Bravo3\Orm\Services\ListManager

Show file Open project: bravo3/orm Class Usage Examples

Public Methods

Method Description
add ( object $entity, string $property, object $value, string $getter = null, string $setter = null ) Add an item to a list
remove ( object $entity, string $property, object $value, array $fns, string $getter = null, string $setter = null ) Remove an item from a list

Protected Methods

Method Description
resolveFunctionNames ( string $property, string $getter = null, string $setter = null ) : string[] Resolve default setter/getter names

Method Details

add() public static method

Add an item to a list
public static add ( object $entity, string $property, object $value, string $getter = null, string $setter = null )
$entity object
$property string Property name to add to, not needed if providing both a getter and setter
$value object Value to add
$getter string Custom getter name
$setter string Custom setter name

remove() public static method

Remove an item from a list
public static remove ( object $entity, string $property, object $value, array $fns, string $getter = null, string $setter = null )
$entity object
$property string Property name to remove from, not needed if providing both a getter and setter
$value object Value to remove
$fns array Array of getter functions which must have equal value to consider a match
$getter string Custom getter name
$setter string Custom setter name

resolveFunctionNames() protected static method

Resolve default setter/getter names
protected static resolveFunctionNames ( string $property, string $getter = null, string $setter = null ) : string[]
$property string
$getter string
$setter string
return string[]