Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
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 ( 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

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

Returns the description of this datafield

Returns
String containing the description
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 (   $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 ( )

Returns the id of the datafield

Returns
String containing the id
getName ( )

Returns the name of the datafield

Returns
String containing the name
getPermsDescription ( )

Returns a human readable string describing the view permissions

Returns
String containing the descriptons of the view permissions
getRangeID ( )

Returns the range id

Returns
String containing the range id
getSecondRangeID ( )

Returns the secondary range id

Returns
String containing the secondary range id
static getSupportedTypes (   $object_type = null)
static

Returns all supported datafield types.

Parameters
stringObject type of the datafield.
Returns
array of supported types
getType ( )

Returns the type of this datafield

Returns
string type of entry
getValue ( )

Returns the value of the datafield

Returns
mixed containing the value
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 ( )

Checks if datafield is empty (was not set)

Returns
bool true if empty, else false
isRequired ( )

Returns whether this datafield is required

Returns
bool indicating whether the datafield is required or not
isValid ( )

Returns whether the datafield contents are valid

Returns
boolean indicating whether the datafield contents are valid
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 ( )

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

Returns
int representing the number of html fields
prettyPrintViewPerms ( )
protected

Generates a full status description depending on the the perms

Returns
string
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 (   $language)

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

Parameters
string$languageThe prefered display language
setRangeID (   $range_id)

Sets the range id

Parameters
String$range_idRange id
setSecondRangeID (   $sec_range_id)

Sets the secondary range id

Parameters
String$sec_range_idSecondary range id
setValue (   $value)

Sets the value

Parameters
mixed$valueThe value
setValueFromSubmit (   $submitted_value)

Sets the value from a post request

Parameters
mixed$submitted_valueThe value from request
store ( )

Stores this datafield entry

Returns
int representing the number of changed entries

Field Documentation

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

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