Stud.IP  trunk Revision
DataFieldEntry Class Reference
Collaboration diagram for DataFieldEntry:
Collaboration graph

Public Member Functions

 __construct (DataField $datafield=null, $rangeID='', $value=null)
 
 store ()
 
 isRequired ()
 
 getDescription ()
 
 getType ()
 
 getDisplayValue ($entities=true)
 
 getValue ()
 
 getName ()
 
 getId ()
 
 getHTML ($name='', $variables=[])
 
 setValue ($value)
 
 setValueFromSubmit ($submitted_value)
 
 setRangeID ($range_id)
 
 setSecondRangeID ($sec_range_id)
 
 setContentLanguage ($language)
 
 isEmpty ()
 
 isValid ()
 
 numberOfHTMLFields ()
 
 getRangeID ()
 
 getSecondRangeID ()
 
 isVisible ($perm=null, $test_ownership=true)
 
 isEditable ($perms=null)
 
 getPermsDescription ()
 

Static Public Member Functions

static getSupportedTypes ($object_type=null)
 
static createDataFieldEntry (DataField $datafield, $rangeID='', $value=null)
 
static getDataFieldEntries ($range_id, $object_type='', $object_class_hint='')
 
static removeAll ($range_id)
 

Data Fields

 $value
 
 $model
 
 $rangeID
 

Protected Member Functions

 prettyPrintViewPerms ()
 

Protected Attributes

 $language = ''
 

Static Protected Attributes

static $supported_types
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

__construct ( DataField  $datafield = null,
  $rangeID = '',
  $value = null 
)

Constructs this datafield

Parameters
DataField$datafieldUnderlying model
mixed$range_idRange id (or array with range id and secondary range id)
mixed$valueValue

Member Function Documentation

◆ createDataFieldEntry()

static createDataFieldEntry ( DataField  $datafield,
  $rangeID = '',
  $value = null 
)
static

Factory method that returns the appropriate datafield object for the given parameters.

Parameters
DataField$datafieldUnderlying structure
String$rangeIDRange id
mixed$valueValue of the entry
Returns
DataFieldEntry instance of appropriate type
Here is the caller graph for this function:

◆ getDataFieldEntries()

static getDataFieldEntries (   $range_id,
  $object_type = '',
  $object_class_hint = '' 
)
static

Enter description here...

Parameters
unknown_type$range_id
unknown_type$object_type
unknown_type$object_class_hint
Returns
unknown
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDescription()

getDescription ( )

Returns the description of this datafield

Returns
String containing the description

◆ getDisplayValue()

getDisplayValue (   $entities = true)

Returns the display/rendered value of this datafield

Parameters
bool$entitiesShould html entities be encoded (defaults to true)
Returns
String containg the rendered value
Here is the call graph for this function:

◆ getHTML()

getHTML (   $name = '',
  $variables = [] 
)

Returns the according input elements as html for this datafield

Parameters
String$nameName prefix of the associated input
Array$variablesAdditional variables
Returns
String containing the required html
Here is the call graph for this function:

◆ getId()

getId ( )

Returns the id of the datafield

Returns
String containing the id

◆ getName()

getName ( )

Returns the name of the datafield

Returns
String containing the name

◆ getPermsDescription()

getPermsDescription ( )

Returns a human readable string describing the view permissions

Returns
String containing the descriptons of the view permissions
Here is the call graph for this function:

◆ getRangeID()

getRangeID ( )

Returns the range id

Returns
String containing the range id
Here is the caller graph for this function:

◆ getSecondRangeID()

getSecondRangeID ( )

Returns the secondary range id

Returns
String containing the secondary range id
Here is the caller graph for this function:

◆ getSupportedTypes()

static getSupportedTypes (   $object_type = null)
static

Returns all supported datafield types.

Parameters
stringObject type of the datafield.
Returns
array of supported types

◆ getType()

getType ( )

Returns the type of this datafield

Returns
string type of entry

◆ getValue()

getValue ( )

Returns the value of the datafield

Returns
mixed containing the value
Here is the caller graph for this function:

◆ isEditable()

isEditable (   $perms = null)

Returns whether the datafield is editable for the current user

Parameters
mixed$permsPerms to test against (optional, defaults to logged in user's perms)
Returns
boolean indicating whether the datafield is editable

◆ isEmpty()

isEmpty ( )

Checks if datafield is empty (was not set)

Returns
bool true if empty, else false
Here is the call graph for this function:

◆ isRequired()

isRequired ( )

Returns whether this datafield is required

Returns
bool indicating whether the datafield is required or not

◆ isValid()

isValid ( )

Returns whether the datafield contents are valid

Returns
boolean indicating whether the datafield contents are valid
Here is the call graph for this function:

◆ isVisible()

isVisible (   $perm = null,
  $test_ownership = true 
)

Returns whether the datafield is visible for the current user

Parameters
String$permPermissions to test against (optional, default to the current user's permissions)
bool$test_ownershipDefines whether the ownership of the field should be taken into account; a field may be invisible for a user according to the permissions but since the datafield belongs to the user, it is visible.
Returns
boolean indicating whether the datafield is visible
Here is the call graph for this function:

◆ numberOfHTMLFields()

numberOfHTMLFields ( )

Returns the number of html fields this datafield uses for input.

Returns
int representing the number of html fields

◆ prettyPrintViewPerms()

prettyPrintViewPerms ( )
protected

Generates a full status description depending on the the perms

Returns
string
Here is the caller graph for this function:

◆ removeAll()

static removeAll (   $range_id)
static

Removes all datafields from a given range_id (and secondary range id if passed as array)

Parameters
mixed$range_idRange id (or array with range id and secondary range id)
Returns
int representing the number of deleted entries
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContentLanguage()

setContentLanguage (   $language)

Sets the prefered content language if this is an i18n datafield.

Parameters
string$languageThe prefered display language
Here is the call graph for this function:

◆ setRangeID()

setRangeID (   $range_id)

Sets the range id

Parameters
String$range_idRange id

◆ setSecondRangeID()

setSecondRangeID (   $sec_range_id)

Sets the secondary range id

Parameters
String$sec_range_idSecondary range id
Here is the call graph for this function:

◆ setValue()

setValue (   $value)

Sets the value

Parameters
mixed$valueThe value
Here is the caller graph for this function:

◆ setValueFromSubmit()

setValueFromSubmit (   $submitted_value)

Sets the value from a post request

Parameters
mixed$submitted_valueThe value from request
Here is the call graph for this function:

◆ store()

store ( )

Stores this datafield entry

Returns
int representing the number of changed entries
Here is the call graph for this function:

Field Documentation

◆ $language

$language = ''
protected

◆ $model

$model

◆ $rangeID

$rangeID

◆ $supported_types

$supported_types
staticprotected
Initial value:
= [
'bool',
'textline',
'textlinei18n',
'textarea',
'textareai18n',
'textmarkup',
'textmarkupi18n',
'selectbox',
'selectboxmultiple',
'date',
'time',
'email',
'phone',
'radio',
'combo',
'link',
]

◆ $value


The documentation for this class was generated from the following file: