Documentation

AbstractOneManyPropertyService implements IModelPropertyProvider

Contains some of the base programming for a property service backed by a single repository and an array property full of IModel instances.

Tags
todo

Write tests for how getValue uses spl_object_id and the garbage collector.

Table of Contents

$propCfg Property config for the service IPropertySvcConfig
$lastId Last id from getValue() int
$init
loadModels() Loads the models from some source array
__construct() Create a new property service mixed
getModelServiceConfig() Get the property config for the main property set IPropertySvcConfig
getSaveFunction() Retrieve the save function used for saving stuff from the provider. IRunnable
getValue() Retrieve the value of some property mixed
setValue() Sets the value of some property void
validate() Test to see if this model is valid prior to save() void
init() Initialize the model. void
getPropertyConfig() Get the property config for the main property set IPropertyConfig
callLoadModels() array
hasAllPriKeyValues() Test to see if some model has values for all primary keys bool

Properties

Methods

loadModels()

Loads the models from some source

protected abstract loadModels( $parentId : int ) : array
Parameters
$parentId : int
Return values
array

getValue()

Retrieve the value of some property

public getValue( $model : IModel , $value : mixed [, $context : array = [] ] ) : mixed
Parameters
$model : IModel
$value : mixed
$context : array = []
Tags
throws
InvalidArgumentException

if the property is invalid

Return values
mixed

value

setValue()

Sets the value of some property

public setValue( $model : IModel , $value : mixed ) : void
Parameters
$model : IModel
$value : mixed

property value

Tags
throws
InvalidArgumentException

if the property is invalid

Search results