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()

__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()

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()

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()

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()

getName ( )

Get the attribute name.

Returns
String

Reimplemented in ReferenceDescription, and TransientAttributeDescription.

Definition at line 104 of file AttributeDescription.php.

◆ getType()

getType ( )

Get the attribute type.

Returns
String

Reimplemented in ReferenceDescription, and TransientAttributeDescription.

Definition at line 112 of file AttributeDescription.php.

◆ getTags()

getTags ( )

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

Returns
Array of String

Reimplemented in ReferenceDescription.

Definition at line 120 of file AttributeDescription.php.

◆ getDefaultValue()

getDefaultValue ( )

Get the default value.

Returns
Mixed

Reimplemented in ReferenceDescription.

Definition at line 128 of file AttributeDescription.php.

◆ getValidateType()

getValidateType ( )

Get the validation type for the value.

Returns
String

Reimplemented in ReferenceDescription.

Definition at line 136 of file AttributeDescription.php.

◆ getValidateDescription()

getValidateDescription ( )

Get the description for the validation type.

Returns
String

Reimplemented in ReferenceDescription.

Definition at line 144 of file AttributeDescription.php.

◆ getIsEditable()

getIsEditable ( )

Check whether the attribute should be editable.

Returns
Boolean

Reimplemented in ReferenceDescription.

Definition at line 152 of file AttributeDescription.php.

◆ getInputType()

getInputType ( )

Get the input type for the value.

Returns
String

Reimplemented in ReferenceDescription.

Definition at line 160 of file AttributeDescription.php.

◆ getDisplayType()

getDisplayType ( )

Get the display type for the value.

Returns
String

Reimplemented in ReferenceDescription.

Definition at line 168 of file AttributeDescription.php.

Member Data Documentation

◆ $name

$name = ''
protected

Definition at line 20 of file AttributeDescription.php.

◆ $type

$type = 'String'
protected

Definition at line 21 of file AttributeDescription.php.

◆ $tags

$tags = []
protected

Definition at line 22 of file AttributeDescription.php.

◆ $defaultValue

$defaultValue = null
protected

Definition at line 23 of file AttributeDescription.php.

◆ $validateType

$validateType = ''
protected

Definition at line 24 of file AttributeDescription.php.

◆ $validateDescription

$validateDescription = ''
protected

Definition at line 25 of file AttributeDescription.php.

◆ $isEditable

$isEditable = true
protected

Definition at line 26 of file AttributeDescription.php.

◆ $inputType

$inputType = 'text'
protected

Definition at line 27 of file AttributeDescription.php.

◆ $displayType

$displayType = 'text'
protected

Definition at line 28 of file AttributeDescription.php.