IPropertySet extends IBigSet
Defines a set of properties that are used within some model.
ie: table column definitions
Note: Property sets MUST be clonable. Be sure to implement __clone() and clone instances of each property in this set.
Tags
Table of Contents
setReadOnly() | Sets the property set to read only. | void |
---|---|---|
getModelValidationArray() | An array of closures for model validation f( IModel ) | array |
addPropertyConfig() | Used to add properties to this property set. | mixed |
getPrimaryKeyNames() | Retrieve the primary key property names. | string[] |
getPrimaryKeys() | Retrieve an array of keys flagged as primary | array |
getPrimaryKey() | Retrieve the property that represents the primary key. | IProperty |
getProperties() | Retrieve a list of all the properties | \buffalokiwi\magicgraph\property\IProperty[] |
getProperty() | Retrieve a property by name | IProperty |
findProperty() | Retrieve a list of properties by flag. | \buffalokiwi\magicgraph\property\IProperty[] |
getPropertiesByType() | Retrieve a list of properties by data type. | \buffalokiwi\magicgraph\property\IProperty[] |
getPropertyConfig() | Retrieve the property configuration | IPropertyConfig |
containsConfig() | Determine if this property set was built using a specific interface. | bool |
getPropertyConfigArray() | Retrieve the product property configuration array | array |
getConfigObjects() | Retrieve a list of all of the currently enabled property config instances attached to this property set. | array |
getPropertiesByFlag() | Retrieve a list of properties by flag. | array |
getNewMembers() | Retrieve a list of property names that have been added via addPropertyConfig(). | array |
setOnAddMember() | void |
Methods
setReadOnly()
Sets the property set to read only.
public
setReadOnly(
)
: void
This is a method because the model still needs to be written to when creating instances populated from persistent storage. The idea is for the mapping object factory to call this method after filling the model, but before returning it.
getModelValidationArray()
An array of closures for model validation f( IModel )
public
getModelValidationArray(
)
: array
Return values
array —Closures
addPropertyConfig()
Used to add properties to this property set.
public
addPropertyConfig(
...$config :
IPropertyConfig
)
: mixed
This MUST be marked as final in the implementing class if it is called by the constructor.
Parameters
- $config : IPropertyConfig
config to add
Tags
Return values
mixedgetPrimaryKeyNames()
Retrieve the primary key property names.
public
getPrimaryKeyNames(
)
: string[]
Return values
string[] —names
getPrimaryKeys()
Retrieve an array of keys flagged as primary
public
getPrimaryKeys(
)
: array
Return values
array —IProperty[] primary keys
getPrimaryKey()
Retrieve the property that represents the primary key.
public
getPrimaryKey(
)
: IProperty
If multiple primary keys are used, this returns the first one in the list. Use getPrimaryKeys() if using compound primary keys.
Return values
IProperty —property
getProperties()
Retrieve a list of all the properties
public
getProperties(
)
: \buffalokiwi\magicgraph\property\IProperty[]
Return values
\buffalokiwi\magicgraph\property\IProperty[] —properties
getProperty()
Retrieve a property by name
public
getProperty(
$name :
string
)
: IProperty
Parameters
- $name : string
name
Return values
IProperty —property
findProperty()
Retrieve a list of properties by flag.
public
findProperty(
$flags :
IPropertyFlags
)
: \buffalokiwi\magicgraph\property\IProperty[]
Parameters
- $flags : IPropertyFlags
Flags to test
Return values
\buffalokiwi\magicgraph\property\IProperty[] —properties
getPropertiesByType()
Retrieve a list of properties by data type.
public
getPropertiesByType(
$type :
IPropertyType
)
: \buffalokiwi\magicgraph\property\IProperty[]
Parameters
- $type : IPropertyType
Type
Return values
\buffalokiwi\magicgraph\property\IProperty[] —properties
getPropertyConfig()
Retrieve the property configuration
public
getPropertyConfig(
$interface :
string
)
: IPropertyConfig
Parameters
- $interface : string
The interface name of the desired property config. If the internal instance does not implement $interface, then an exception is thrown.
Tags
Return values
IPropertyConfigcontainsConfig()
Determine if this property set was built using a specific interface.
public
containsConfig(
$interface :
string
)
: bool
Parameters
- $interface : string
Interface to test.
Return values
bool —Implements
getPropertyConfigArray()
Retrieve the product property configuration array
public
getPropertyConfigArray(
)
: array
Return values
arraygetConfigObjects()
Retrieve a list of all of the currently enabled property config instances attached to this property set.
public
getConfigObjects(
)
: array
Return values
array —IPropertyConfig[] config instances
getPropertiesByFlag()
Retrieve a list of properties by flag.
public
getPropertiesByFlag(
...$flags :
string
)
: array
Parameters
- $flags : string
flags
Return values
array —properties
getNewMembers()
Retrieve a list of property names that have been added via addPropertyConfig().
public
getNewMembers(
)
: array
Return values
array —names
setOnAddMember()
public
setOnAddMember(
$callback :
Closure
)
: void
Parameters
- $callback : Closure