Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Asset_Attribute Class Reference
Inheritance diagram for Asset_Attribute:
MySource_Object Asset_Attribute_Assetid Asset_Attribute_Boolean Asset_Attribute_Colour Asset_Attribute_CSS_Dimension Asset_Attribute_DateTime Asset_Attribute_Duration Asset_Attribute_Float Asset_Attribute_HTML_Width Asset_Attribute_Int Asset_Attribute_Option_List Asset_Attribute_Selection Asset_Attribute_Serialise Asset_Attribute_Text Asset_Attribute_Url

Public Member Functions

 Asset_Attribute ($attributeid=0, $value=NULL, $default_params=Array())
 
loadAttribute ($attributeid=0, $value=NULL, $default_params=Array())
 
 type ()
 
 paint ($prefix, $read_only=FALSE)
 
 paintEditParams ($prefix, $write_access=FALSE)
 
 processEditParams ($prefix)
 
 process ($prefix)
 
 validateValue (&$value)
 
 setValue (&$value)
 
 setEditParams (&$node)
 
 setEditParam ($field, $value)
 
 setParam ($field, $value)
 
 getContent ()
 
 getKeywordValue ($format='')
 
 exportToXML ()
 
 exportContentsToXML ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Data Fields

 $id = 0
 
 $name = ''
 
 $uniq = FALSE
 
 $description = ''
 
 $_params = Array()
 
 $_default_value = NULL
 
 $_edit_params = Array()
 
 $value = NULL
 
 $processed = FALSE
 
 $is_admin = FALSE
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Detailed Description

Definition at line 28 of file asset_attribute.inc.

Member Function Documentation

Asset_Attribute (   $attributeid = 0,
  $value = NULL,
  $default_params = Array() 
)

Constructor

Parameters
int$attributeidthe attribute id to be loaded
mixed$valuethe current value for the element
array$default_paramsthe default values for the params

Definition at line 100 of file asset_attribute.inc.

exportContentsToXML ( )

Returns a representation of this asset's parameters, edit parameters and value as XML

This function will be overridden by children who do not use getContent to get their value

Returns
string public

Definition at line 455 of file asset_attribute.inc.

exportToXML ( )

Returns a representation of this asset in XML

Returns
string public

Definition at line 423 of file asset_attribute.inc.

getContent ( )

Returns the raw content of this attribute type

Returns
string public

Definition at line 394 of file asset_attribute.inc.

getKeywordValue (   $format = '')

Returns the content of this attribute as it should be shown in a keyword replacement

Parameters
string$formatFormat suffix
Returns
void public

Definition at line 409 of file asset_attribute.inc.

& loadAttribute (   $attributeid = 0,
  $value = NULL,
  $default_params = Array() 
)

Retrieves subclasses of Asset_Attribute, static method

Parameters
int$attributeidthe attribute id to be loaded
mixed$valuethe current value for the element
array$default_paramsthe default values for the params
Returns
mixed object public

Definition at line 169 of file asset_attribute.inc.

paint (   $prefix,
  $read_only = FALSE 
)

Prints the interface for filling in a value

Parameters
string$prefixprefix for the form element
boolean$read_onlyare we just printing the value
Returns
void public

Definition at line 221 of file asset_attribute.inc.

paintEditParams (   $prefix,
  $write_access = FALSE 
)

Print the interface for changing some params

Attributes must override this function

Parameters
string$prefixprefix for the form element
boolean$write_accesswrite access
Returns
boolean public

Definition at line 239 of file asset_attribute.inc.

process (   $prefix)

Prints the interface for filling in a value

Parameters
string$prefixprefix for the form element
Returns
void public

Definition at line 271 of file asset_attribute.inc.

processEditParams (   $prefix)

Process the interface for changing some params

Attributes must override this function

Parameters
string$prefixprefix for the form element
Returns
boolean public

Definition at line 256 of file asset_attribute.inc.

setEditParam (   $field,
  $value 
)

Manually set the value of an edit parameter for this attribute

The parameter must already contain a default value to be set with this function It returns TRUE if parameter set successfully

Parameters
string$fieldThe parameter field to set
mixed$valueThe value to set it to
Returns
boolean public

Definition at line 350 of file asset_attribute.inc.

setEditParams ( $node)

Takes an XML_Tree_Node from an edit interface XML file and creates the params array from it

Parameters
object&$nodeSimpleXMLElement
Returns
boolean public

Definition at line 326 of file asset_attribute.inc.

setParam (   $field,
  $value 
)

Manually set the value of an parameter for this attribute

The parameter must already contain a default value to be set with this function It returns TRUE if parameter set successfully

Parameters
string$fieldThe parameter field to set
mixed$valueThe value to set it to
Returns
boolean public

Definition at line 375 of file asset_attribute.inc.

setValue ( $value)

Sets the value of this attribute after validating

Parameters
mixed&$valuevalue to be validated
Returns
boolean public

Definition at line 305 of file asset_attribute.inc.

type ( )

Returns the type of this attribute

Returns
string public

Definition at line 203 of file asset_attribute.inc.

validateValue ( $value)

Validate the value of this attribute - children should overwrite

This function should return FALSE if the passed-in value is irreparably invalid. If the value is only trivially invalid this function may tweak it to make it valid, but it is NOT the job of this function to change an invalid value to this attribute's default value.

Parameters
mixed&$valuevalue to be validated
Returns
boolean public

Definition at line 290 of file asset_attribute.inc.


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