Class CMS_poly_object

Description

Class CMS_poly_object

represent a polymorphic object

Located in /automne/classes/modules/polymod/polyobjects/poly_object.php (line 25)

CMS_grandFather
   |
   --CMS_resource
      |
      --CMS_poly_object
Class Constant Summary
Method Summary
 static boolean afterValidation (integer $validationResult)
 static array(integer getListOfNamesForObject ([boolean $public = false], [ $searchConditions = array()], array $searchConditions,)
 void __construct (integer $objectID, [integer $id = 0], [array $datas = array()], [ $public = false], [ $loadObject = true], [ $loadSubObjectsValues = true], boolean $public,, boolean $loadObject,, boolean $loadSubObjectsValues,)
 boolean checkMandatory ( $fieldID, string $values, boolean $prefixName, [ $newFormat = false])
 boolean delete ([boolean $hardDelete = false])
 string, getFieldDesc (mixed $language)
 string, getFieldLabel (mixed $language)
 string getFieldOrderSQL (integer $fieldID, mixed $direction, string $operator, string $where, [boolean $public = false])
 string getFieldSearchSQL (integer $fieldID, mixed $value, string $operator, string $where, [boolean $public = false])
 array getFieldsObjects ()
 string getHTMLAdmin ( $fieldID, string $language,  $prefixName, CMS_language $language,)
 string getHTMLDescription ()
 integer, getID ()
 string getInput ( $fieldID, multidimentionnal $language,  $inputParams, array $values)
 string getLabel ()
 array getLabelsStructure ( &$language,  $objectName)
 integer, getLanguage ()
 array getLanguages ()
 integer, getObjectID ()
 string getPrevizPageURL ([boolean $addPrevizParameter = true])
 CMS_date, getPublicationDate ()
 string getSoapValues (integer $fieldID, object $language)
 multidimentionnal getStructure ()
 array(integer getSubFieldsDefinition ([integer $objectID = ""])
 string getTypeLabel (mixed $language)
 mixed getValue (string $name, [string $parameters = ''])
 boolean isDeleted ()
 multidimentionnal isInUserSpace (boolean $public)
 void loadObject (array $values, multidimentionnal $tags)
 mixed objectValues ([integer $fieldID = ''])
 string rss (array $values, multidimentionnal $tags)
 string scriptInfo (array $parameters)
 Boolean scriptTask (array $parameters)
 string selectOptions (array $values, multidimentionnal $tags)
 void setField ($field $field)
 boolean setSoapValues (integer $fieldID,  $domdocument, object $language, string $xml)
 boolean setValues (integer $fieldID, array $values,  $prefix, [boolean $newFormat = false], string $prefixname)
 boolean undelete ()
 boolean userHasClearance (cms_profile_user $user, [constant $clearance = CLEARANCE_MODULE_VIEW], [boolean $checkParent = false])
 boolean writeToPersistence ([ $treatResource = true], [boolean $emailValidators = true], [boolean $onlyCreateID = false], boolean $withResource)
 boolean _loadObject ()
 boolean _populateSubObjects ()
 boolean _populateSubObjectsValues (array $datas)
Methods
static afterValidation (line 2069)

Current object has passed the validation process

  • access: public
static boolean afterValidation (integer $validationResult)
  • integer $validationResult: : the validation status
static getListOfNamesForObject (line 2057)

Return a list of all objects names of given type

  • return: objectID => string objectName)
  • access: public
static array(integer getListOfNamesForObject ([boolean $public = false], [ $searchConditions = array()], array $searchConditions,)
  • boolean $public: are the needed datas public ? (default false)
  • array $searchConditions,: search conditions to add. Format : array(conditionType => conditionValue)
  • $searchConditions
Constructor __construct (line 177)

Constructor.

initialize object.

  • access: public
void __construct (integer $objectID, [integer $id = 0], [array $datas = array()], [ $public = false], [ $loadObject = true], [ $loadSubObjectsValues = true], boolean $public,, boolean $loadObject,, boolean $loadSubObjectsValues,)
  • integer $objectID: the object type id in catalog (relative to id in mod_object_def table)
  • integer $id: the object id (relative to id in mod_object_polyobjects table)
  • array $datas: the object and sub objects values
  • boolean $public,: object values are public or edited ? (default is edited)
  • boolean $loadObject,: load object values from db if not found in params ?
  • boolean $loadSubObjectsValues,: /!\ Experimental /!\ Load subobjects datas. Default : true. Only for public objects. in case of large objects to manage, we can limit the memory usage by disallow loading of sub objects datas structure.
  • $public
  • $loadObject
  • $loadSubObjectsValues
checkMandatory (line 1111)

check object Mandatories Values

  • return: true on success, false on failure
  • access: public
boolean checkMandatory ( $fieldID, string $values, boolean $prefixName, [ $newFormat = false])
  • string $values: prefixname : the prefix used for post names
  • boolean $prefixName: newFormat : new automne v4 format (default false for compatibility)
  • $fieldID
  • $newFormat
delete (line 1467)

Delete object and values.

If object is a primary resource, this deletion is submitted to validation and an email is sent to validators.

  • return: true on success, false on failure
  • access: public
boolean delete ([boolean $hardDelete = false])
  • boolean $hardDelete: : completely destroy object and associated resource if any. After this, this object will no longer exists at all. Default : false. /!\ if object is a primary resource, no validation will be queried to validators, object will be directly destroyed from all locations. /!\
getAllSecondaryResourcesForPrimaryResource (line 1620)

get all secondary resources ids attached to this primary resource

  • return: of secondary resource poly_object ids
  • access: public
array getAllSecondaryResourcesForPrimaryResource ()
getFieldDesc (line 1299)

get admin field description

  • return: the description
  • access: public
string, getFieldDesc (mixed $language)
  • mixed $language: the language code (string) or the CMS_language (object) to use for label
getFieldLabel (line 1282)

get admin field label

  • return: the label
  • access: public
string, getFieldLabel (mixed $language)
  • mixed $language: the language code (string) or the CMS_language (object) to use for label
getFieldOrderSQL (line 2231)

Get field order SQL request (used by class CMS_object_search)

  • return: : the SQL request
  • access: public
string getFieldOrderSQL (integer $fieldID, mixed $direction, string $operator, string $where, [boolean $public = false])
  • integer $fieldID: : this field id in object (aka $this->_field->getID())
  • mixed $direction: : the direction to search (asc/desc)
  • string $operator: : additionnal search operator
  • string $where: : where clauses to add to SQL
  • boolean $public: : values are public or edited ? (default is edited)
getFieldSearchSQL (line 2033)

Get field search SQL request (used by class CMS_object_search)

  • return: : the SQL request
  • access: public
string getFieldSearchSQL (integer $fieldID, mixed $value, string $operator, string $where, [boolean $public = false])
  • integer $fieldID: : this field id in object
  • mixed $value: : the value to search
  • string $operator: : additionnal search operator
  • string $where: : where clauses to add to SQL
  • boolean $public: : values are public or edited ? (default is edited)
getFieldsObjects (line 417)

Get all subobject

  • return: of mixed cms_object_{type}
  • access: public
array getFieldsObjects ()
getHTMLAdmin (line 699)

get HTML admin (used to enter object values in admin)

  • return: : the html admin
  • access: public
string getHTMLAdmin ( $fieldID, string $language,  $prefixName, CMS_language $language,)
  • CMS_language $language,: the current admin language
  • string $language: prefixname : the prefix to use for post names
  • $fieldID
  • $prefixName
getHTMLDescription (line 1229)

get object HTML description for admin search detail. Usually, the label.

  • return: : object HTML description
  • access: public
string getHTMLDescription ()
getID (line 395)

Get field ID

  • return: the DB object ID
  • access: public
integer, getID ()

Redefinition of:
CMS_resource::getID()
Gets the DB ID of the instance.
getInput (line 1051)

Return the needed form field tag for current object field

  • return: : the form field HTML tag
  • access: public
string getInput ( $fieldID, multidimentionnal $language,  $inputParams, array $values)
  • array $values: : parameters values array(parameterName => parameterValue) in : id : the form field id to set
  • multidimentionnal $language: array $tags : xml2Array content of atm-function tag
  • $fieldID
  • $inputParams
getLabel (line 1137)

get object label (composed by some objects fields)

  • return: : the object name
  • access: public
string getLabel ()
getLabelsStructure (line 1985)

get labels for object structure and functions

  • return: : the labels of object structure and functions
  • access: public
array getLabelsStructure ( &$language,  $objectName)
  • &$language
  • $objectName
getLanguage (line 450)

get object language if any language field exists else, return APPLICATION_DEFAULT_LANGUAGE

  • return: the object resource status
  • access: public
integer, getLanguage ()
getLanguages (line 478)

Get languages for object from

  • Categories (which support multi language)
  • Sub object multiple which has a language field

  • return: of supported languages codes or false if only one language is supported
  • access: public
array getLanguages ()
getObjectDefinition (line 550)

Get object Definition (CMS_poly_object_definition)

  • access: public
CMS_poly_object_definition getObjectDefinition ()
getObjectID (line 406)

Get object ID

  • return: the DB object ID
  • access: public
integer, getObjectID ()
getObjectResourceStatus (line 428)

get object resource status beware, for secondary resources, real status is not checked, use isSecondaryResource method of CMS_poly_object_definition instead

  • return: the object resource status
  • access: public
integer, getObjectResourceStatus ()
getPrevizPageURL (line 1174)

get object previzualisation URL if set

  • return: : the object previzualisation URL or false if none set
  • access: public
string getPrevizPageURL ([boolean $addPrevizParameter = true])
  • boolean $addPrevizParameter: : add the previz=previz parameter at end of address (default : true)
getPublicationDate (line 518)

Get object publication date If object is a primary resource, return resource pub date else, try to find a date field with creation date

  • return: the publication date object if any (false otherwise)
  • access: public
CMS_date, getPublicationDate ()
getSoapValues (line 584)

Get soap values

  • return: XML definition
  • access: public
string getSoapValues (integer $fieldID, object $language)
  • integer $fieldID: The field ID
  • object $language: The CMS_language to deal with
getStructure (line 1676)

get object values structure available with getValue method

  • return: array : the object values structure
  • access: public
multidimentionnal getStructure ()
getSubFieldsDefinition (line 561)

Get subfields definition for current object

  • return: "subFieldID" => array("type" => string [integer|string|text|date], "objectID" => integer, "fieldID" => integer, "subFieldID" => integer))
  • access: public
array(integer getSubFieldsDefinition ([integer $objectID = ""])
  • integer $objectID: (can be null - for compatibility only) $objectID the object ID who requests these infos
getTypeLabel (line 1163)

get object type label

  • return: : the object name
  • access: public
string getTypeLabel (mixed $language)
  • mixed $language: the language code (string) or the CMS_language (object) to use for label
getValue (line 1732)

get an object value

  • return: : the object values structure
  • access: public
mixed getValue (string $name, [string $parameters = ''])
  • string $name: : the name of the value to get
  • string $parameters: (optional) : parameters for the value to get
isDeleted (line 1582)

Is this object deleted

  • return: true on success, false on failure
  • access: public
boolean isDeleted ()
isInUserSpace (line 1655)

Is this object currently in userspace return true if object is not deleted (for edited object) and if object is valided and in range of publications date (for public primary resource object)

  • return: array : the object values structure
  • access: public
multidimentionnal isInUserSpace (boolean $public)
  • boolean $public: : public userspace (else, it is edited userpsace) default : false
loadObject (line 1929)

For an object ID, set object

  • access: public
void loadObject (array $values, multidimentionnal $tags)
  • array $values: : parameters values array(parameterName => parameterValue) in : value : the object id which to be set
  • multidimentionnal $tags: array $tags : xml2Array content of atm-function tag (nothing for this one)
objectValues (line 1709)

get an object field

  • return: : the object field or an array of the object fields
  • access: public
mixed objectValues ([integer $fieldID = ''])
  • integer $fieldID: : the field to get. If empty, return an array of all objects values
rss (line 1949)

Return given RSS feed informations

  • return: : the RSS feed informations
  • access: public
string rss (array $values, multidimentionnal $tags)
  • array $values: : parameters values array(parameterName => parameterValue) in : selected : the selected rss ID
  • multidimentionnal $tags: array $tags : xml2Array content of atm-function tag ... {url} ... {label} ... {description} ...
scriptInfo (line 2193)

Module script info : get infos for a given script parameters

  • return: : HTML scripts infos
  • access: public
string scriptInfo (array $parameters)
  • array $parameters: the task parameters task : string task to execute module : string module codename for the task uid : string module uid
scriptTask (line 2091)

Module script task

  • return: true/false
  • access: public
Boolean scriptTask (array $parameters)
  • array $parameters: the task parameters task : string task to execute object : string module codename for the task field : string module uid ... : optional field relative parameters
selectOptions (line 1908)

For a given object type, return options tag list (for a select tag) of all objects labels

  • return: : options tag list
  • access: public
string selectOptions (array $values, multidimentionnal $tags)
  • array $values: : parameters values array(parameterName => parameterValue) in : selected : the object id which is selected (optional)
  • multidimentionnal $tags: array $tags : xml2Array content of atm-function tag (nothing for this one)
setField (line 439)

set CMS_poly_object_field reference (only if this object is used as a field of another object)

  • access: public
void setField ($field $field)
  • $field $field: CMS_poly_object_field : the field reference for this object
setSoapValues (line 636)

Get soap values

  • return: true on success, false on failure
  • access: public
boolean setSoapValues (integer $fieldID,  $domdocument, object $language, string $xml)
  • integer $fieldID: The field ID
  • object $language: The CMS_language to deal with
  • string $xml: Values to set
  • $domdocument
setValues (line 1243)

set fields objects Values

  • return: true on success, false on failure
  • access: public
boolean setValues (integer $fieldID, array $values,  $prefix, [boolean $newFormat = false], string $prefixname)
  • integer $fieldID: : the object field id to set values
  • array $values: : the POST result values
  • string $prefixname: : the prefix used for post names
  • boolean $newFormat: newFormat : new automne v4 format (default false for compatibility)
  • $prefix
undelete (line 1592)

Un-delete an object proposed for deletion (only for primary resource object type)

  • return: true on success, false on failure
  • access: public
boolean undelete ()
userHasClearance (line 2266)

Does given user have the requested clearance for this object ? This method is pretty heavy, so if it must be used on a lots of objects, prefer usage of a search on those objects, it is much faster.

  • access: public
boolean userHasClearance (cms_profile_user $user, [constant $clearance = CLEARANCE_MODULE_VIEW], [boolean $checkParent = false])
  • cms_profile_user $user: : the user to check clearance
  • constant $clearance: : the requested clearance to check (default : CLEARANCE_MODULE_VIEW)
  • boolean $checkParent: : if no categories fields founded, check the parent object (if any) to see if it as some (beware this is heavy). Default : false
writeToPersistence (line 1318)

Writes all objects values into persistence (MySQL for now), along with base data.

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ([ $treatResource = true], [boolean $emailValidators = true], [boolean $onlyCreateID = false], boolean $withResource)
  • boolean $withResource: treat also the resource status (if object is a primary resource) default true
  • boolean $emailValidators: send emails to validators (if object is a primary resource) default true
  • boolean $onlyCreateID: create only the object ID (used to save fiels fields). Default false
  • $treatResource

Redefinition of:
CMS_resource::writeToPersistence()
Writes the resource into persistence (MySQL for now).
_loadObject (line 238)

load all object and subobjects values from DB

  • return: true on success, false on failure
  • access: private
boolean _loadObject ()
_populateSubObjects (line 339)

Sets clean subobjects

  • return: true on success, false on failure
  • access: private
boolean _populateSubObjects ()
_populateSubObjectsDefinitions (line 363)

Sets subObjectsDefinitions

  • return: true on success, false on failure
  • access: private
boolean _populateSubObjectsDefinitions ()
_populateSubObjectsValues (line 265)

Sets subobjects Values

  • return: true on success, false on failure
  • access: private
boolean _populateSubObjectsValues (array $datas)
  • array $datas: datas : array created by loadObject method array(integer objectID => array(integer objectFieldID => array(integer objectSubFieldID => array(DB values))))

Inherited Methods

Inherited From CMS_resource

 CMS_resource::CMS_resource()
 CMS_resource::addEdition()
 CMS_resource::addValidationRefused()
 CMS_resource::cancelAllEditions()
 CMS_resource::destroy()
 CMS_resource::getAllDataLocations()
 CMS_resource::getAllLinkTypes()
 CMS_resource::getEditors()
 CMS_resource::getEditorsStack()
 CMS_resource::getID()
 CMS_resource::getLocation()
 CMS_resource::getLock()
 CMS_resource::getLockDate()
 CMS_resource::getProposedLocation()
 CMS_resource::getPublication()
 CMS_resource::getPublicationDateEnd()
 CMS_resource::getPublicationDateStart()
 CMS_resource::getStatus()
 CMS_resource::isProposedForOutsideUserspace()
 CMS_resource::lock()
 CMS_resource::removeProposedLocation()
 CMS_resource::resetEditorsStack()
 CMS_resource::setProposedLocation()
 CMS_resource::setPublicationDates()
 CMS_resource::unlock()
 CMS_resource::validateEdition()
 CMS_resource::validateProposedLocation()
 CMS_resource::writeToPersistence()

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_OBJECT_DELETION_AWAIT_NOTIFICATION = 365 (line 56)
MESSAGE_OBJECT_FIELD_DESC_DESCRIPTION = 402 (line 57)
MESSAGE_OBJECT_VALIDATION_AWAIT_NOTIFICATION = 364 (line 55)
MESSAGE_PAGE_ACTION_ASSOCIATE = 1267 (line 61)
MESSAGE_PAGE_ACTION_DESASSOCIATE = 1268 (line 63)
MESSAGE_PAGE_ACTION_DESASSOCIATE_CONFIRM = 607 (line 66)
MESSAGE_PAGE_ACTION_MODIFIY = 261 (line 67)
MESSAGE_PAGE_ACTION_NEW = 262 (line 69)
MESSAGE_POLYMOD_ACTION_EMAIL_BODY = 32 (line 34)
MESSAGE_POLYMOD_ACTION_EMAIL_DELETE_BODY = 55 (line 36)
MESSAGE_POLYMOD_ACTION_EMAIL_DELETE_SUBJECT = 53 (line 35)
MESSAGE_POLYMOD_ACTION_EMAIL_SUBJECT = 31 (line 33)
MESSAGE_POLYMOD_CHOOSE_OBJECT = 1132 (line 31)
MESSAGE_POLYMOD_EMPTY_OBJECTS_SET = 265 (line 30)

Standard Messages

MESSAGE_POLYOBJECT_DATEEND_FORMATEDVALUE_DESCRIPTION = 204 (line 51)
MESSAGE_POLYOBJECT_DATESTART_FORMATEDVALUE_DESCRIPTION = 203 (line 50)
MESSAGE_POLYOBJECT_DATE_HASVALUE_DESCRIPTION = 411 (line 58)
MESSAGE_POLYOBJECT_DATE_TIMESTAMP_DESCRIPTION = 605 (line 59)
MESSAGE_POLYOBJECT_FIELDID_DESCRIPTION = 146 (line 47)
MESSAGE_POLYOBJECT_FIELDNAME_DESCRIPTION = 118 (line 43)
MESSAGE_POLYOBJECT_FUNCTION_LOADOBJECT_DESCRIPTION = 312 (line 53)
MESSAGE_POLYOBJECT_FUNCTION_RSS_DESCRIPTION = 311 (line 52)
MESSAGE_POLYOBJECT_FUNCTION_SELECTOPTIONS_DESCRIPTION = 162 (line 49)
MESSAGE_POLYOBJECT_ID_DESCRIPTION = 141 (line 41)

Polymod Messages

MESSAGE_POLYOBJECT_LABEL_DESCRIPTION = 142 (line 42)
MESSAGE_POLYOBJECT_OBJECTDESC_DESCRIPTION = 144 (line 45)
MESSAGE_POLYOBJECT_OBJECTNAME_DESCRIPTION = 143 (line 44)
MESSAGE_POLYOBJECT_OBJECTTYPE_DESCRIPTION = 145 (line 46)
MESSAGE_POLYOBJECT_OBJECT_CHOOSE_ELEMENT = 518 (line 62)
MESSAGE_POLYOBJECT_OBJECT_CREATE_ZONE = 193 (line 70)
MESSAGE_POLYOBJECT_OBJECT_DISASSOCIATE_ELEMENT = 517 (line 64)
MESSAGE_POLYOBJECT_OBJECT_EDIT_ELEMENT = 516 (line 68)
MESSAGE_POLYOBJECT_OBJECT_LIST_ZONE = 633 (line 60)
MESSAGE_POLYOBJECT_OBJECT_SELECT_BEFORE = 608 (line 65)
MESSAGE_POLYOBJECT_REQUIRED_DESCRIPTION = 366 (line 54)
MESSAGE_POLYOBJECT_RESOURCE_DESCRIPTION = 147 (line 48)

Inherited Constants

Inherited from CMS_resource

CMS_resource::MESSAGE_RESOURCE_LINK_TYPE_EXTERNAL
CMS_resource::MESSAGE_RESOURCE_LINK_TYPE_FILE
CMS_resource::MESSAGE_RESOURCE_LINK_TYPE_INTERNAL
CMS_resource::MESSAGE_RESOURCE_LINK_TYPE_NONE

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:37:16 +0100 by phpDocumentor 1.4.3