AttributeDescription Class Reference

Detailed Description

Instances of AttributeDescription describe attributes of PersistentObjects.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 18 of file AttributeDescription.php.

+ Inheritance diagram for AttributeDescription:

Public Member Functions

 __construct ($name, $type, array $tags, $defaultValue, $validateType, $validateDescription, $isEditable, $inputType, $displayType)
 
 hasTag ($tag)
 
 matchTags (array $tags=[], $matchMode='all')
 
 getPropertyNames ()
 
 getName ()
 
 getType ()
 
 getTags ()
 
 getDefaultValue ()
 
 getValidateType ()
 
 getValidateDescription ()
 
 getIsEditable ()
 
 getInputType ()
 
 getDisplayType ()
 

Protected Attributes

 $name = ''
 
 $type = 'String'
 
 $tags = []
 
 $defaultValue = null
 
 $validateType = ''
 
 $validateDescription = ''
 
 $isEditable = true
 
 $inputType = 'text'
 
 $displayType = 'text'
 

Constructor & Destructor Documentation

__construct (   $name,
  $type,
array  $tags,
  $defaultValue,
  $validateType,
  $validateDescription,
  $isEditable,
  $inputType,
  $displayType 
)

Constructor.

Parameters
$nameThe attribute name
$typeThe attribute type
$tagsAn array of application specific tags that this attribute is tagged with
$defaultValueThe default value (will be set when creating a blank object, see PersistenceMapper::create())
$validateTypeA validation type for the value
$validateDescriptionA description for the validation type
$isEditableBoolean whether the attribute should be editable, see Control::render()
$inputTypeThe input type for the value, see Control::render()
$displayTypeThe display type for the value

Definition at line 42 of file AttributeDescription.php.

Member Function Documentation

hasTag (   $tag)

Check if this attribute has the given application specific tag.

Parameters
$tagTag that the attribute should have
Returns
Boolean

Definition at line 60 of file AttributeDescription.php.

matchTags ( array  $tags = [],
  $matchMode = 'all' 
)

Check if this attribute is tagged with the given application specific tags.

Parameters
$tagsAn array of tags that the attribute should match. Empty array results in true the given matchMode (default: empty array)
$matchModeOne of 'all', 'none', 'any', defines how the attribute's tags should match the given tags (default: 'all')
Returns
True if the attribute tags satisfy the match mode, false else

Definition at line 70 of file AttributeDescription.php.

getPropertyNames ( )

Return an array of property names defined in this attribute description.

Returns
An array of names

Definition at line 95 of file AttributeDescription.php.

getName ( )

Get the attribute name.

Returns
String

Definition at line 104 of file AttributeDescription.php.

getType ( )

Get the attribute type.

Returns
String

Definition at line 112 of file AttributeDescription.php.

getTags ( )

Get the application specific tags that this attribute is tagged with.

Returns
Array of String

Definition at line 120 of file AttributeDescription.php.

getDefaultValue ( )

Get the default value.

Returns
Mixed

Definition at line 128 of file AttributeDescription.php.

getValidateType ( )

Get the validation type for the value.

Returns
String

Definition at line 136 of file AttributeDescription.php.

getValidateDescription ( )

Get the description for the validation type.

Returns
String

Definition at line 144 of file AttributeDescription.php.

getIsEditable ( )

Check whether the attribute should be editable.

Returns
Boolean

Definition at line 152 of file AttributeDescription.php.

getInputType ( )

Get the input type for the value.

Returns
String

Definition at line 160 of file AttributeDescription.php.

getDisplayType ( )

Get the display type for the value.

Returns
String

Definition at line 168 of file AttributeDescription.php.

Member Data Documentation

$name = ''
protected

Definition at line 20 of file AttributeDescription.php.

$type = 'String'
protected

Definition at line 21 of file AttributeDescription.php.

$tags = []
protected

Definition at line 22 of file AttributeDescription.php.

$defaultValue = null
protected

Definition at line 23 of file AttributeDescription.php.

$validateType = ''
protected

Definition at line 24 of file AttributeDescription.php.

$validateDescription = ''
protected

Definition at line 25 of file AttributeDescription.php.

$isEditable = true
protected

Definition at line 26 of file AttributeDescription.php.

$inputType = 'text'
protected

Definition at line 27 of file AttributeDescription.php.

$displayType = 'text'
protected

Definition at line 28 of file AttributeDescription.php.