Documentation

OneOneROPropertyService extends OneOnePropertyService

A one to one read only property service.

The attached model will not be saved if edits are made.

Table of Contents

$repo Repo IRepository
$propCfg Property config for the service IPropertySvcConfig
$lastId Last id from getValue() int
validate() Test to see if this model is valid prior to save() void
getSaveFunction() Retrieve the save function used for saving stuff from the provider. \buffalokiwi\magicgraph\persist\IRunnable[]
__construct() Create a new property service mixed
onSave() array
loadById() Loads an item from somewhere by id. IModel
getModelServiceConfig() Get the property config for the main property set IPropertySvcConfig
getSaveFunction() Retrieve the save function used for saving stuff from the provider. \buffalokiwi\magicgraph\persist\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

Properties

Methods

getSaveFunction()

Retrieve the save function used for saving stuff from the provider.

public getSaveFunction( $parent : IModel ) : \buffalokiwi\magicgraph\persist\IRunnable[]

This does nothing in this implementation.

Parameters
$parent : IModel
Return values
\buffalokiwi\magicgraph\persist\IRunnable[]

loadById()

Loads an item from somewhere by id.

protected abstract loadById( $id : int ) : IModel

If $id == 0, then this must return an empty model.

Parameters
$id : int

Id

Return values
IModel

Model

getSaveFunction()

Retrieve the save function used for saving stuff from the provider.

public getSaveFunction( $parent : IModel ) : \buffalokiwi\magicgraph\persist\IRunnable[]
Parameters
$parent : IModel
Return values
\buffalokiwi\magicgraph\persist\IRunnable[]

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