Stud.IP  6.0
DataFieldEntry Class Reference
Inheritance diagram for DataFieldEntry:
DataFieldBoolEntry DataFieldComboEntry DataFieldDateEntry DataFieldEmailEntry DataFieldI18NEntry DataFieldLinkEntry DataFieldPhoneEntry DataFieldSelectboxEntry DataFieldTextareaEntry DataFieldTextlineEntry DataFieldTimeEntry

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 = ''
 
 $template = null
 

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

◆ getDataFieldEntries()

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

Enter description here...

Parameters
string$range_id
string$object_type
string$object_class_hint
Returns
array

◆ 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

◆ 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

◆ 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

◆ getRangeID()

getRangeID ( )

Returns the range id

Returns
String containing the range id

◆ getSecondRangeID()

getSecondRangeID ( )

Returns the secondary range id

Returns
String containing the secondary range id

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ setContentLanguage()

setContentLanguage (   $language)

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

Parameters
string$languageThe prefered display language

◆ 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

◆ setValue()

setValue (   $value)

Sets the value

Parameters
mixed$valueThe value

◆ setValueFromSubmit()

setValueFromSubmit (   $submitted_value)

Sets the value from a post request

Parameters
mixed$submitted_valueThe value from request

◆ store()

store ( )

Stores this datafield entry

Returns
int representing the number of changed entries

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',
]

◆ $template

$template = null
protected

◆ $value


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