eZPublish(LegacyStack)  5.1
eZPersistentObject Class Reference

Inherited by eZBasket, eZBinaryFile, eZCollaborationGroup, eZCollaborationItem, eZCollaborationItemGroupLink, eZCollaborationItemMessageLink, eZCollaborationItemParticipantLink, eZCollaborationItemStatus, eZCollaborationNotificationRule, eZCollaborationProfile, eZCollaborationSimpleMessage, eZContentBrowseBookmark, eZContentBrowseRecent, eZContentClass, eZContentClassAttribute, eZContentClassClassGroup, eZContentClassGroup, eZContentClassName, eZContentLanguage, eZContentObject, eZContentObjectAttribute, eZContentObjectState, eZContentObjectStateGroup, eZContentObjectStateGroupLanguage, eZContentObjectStateLanguage, eZContentObjectTreeNode, eZContentObjectVersion, eZCurrencyData, eZDiscountRule, eZDiscountSubRule, eZDiscountSubRuleValue, eZEnumObjectValue, eZEnumValue, eZForgotPassword, eZGeneralDigestUserSettings, eZImageFile, eZInformationCollection, eZInformationCollectionAttribute, eZISBNGroup, eZISBNGroupRange, eZISBNRegistrantRange, eZMedia, eZMultiPriceData, eZNodeAssignment, eZNotificationCollection, eZNotificationCollectionItem, eZNotificationEvent, eZOperationMemento, eZOrder, eZOrderItem, eZOrderStatus, eZOrderStatusHistory, eZPathElement, eZPaymentObject, ezpContentPublishingProcess, eZPDFExport, eZPendingActions, eZPolicy, eZPolicyLimitation, eZPolicyLimitationValue, eZProductCategory, eZProductCollection, eZProductCollectionItem, eZProductCollectionItemOption, eZRole, eZRSSExport, eZRSSExportItem, eZRSSImport, eZSection, eZSiteData, eZSubtreeNotificationRule, eZTipafriendCounter, eZTipafriendRequest, eZTrigger, eZURL, eZURLAliasML, eZURLObjectLink, eZURLWildcard, eZUser, eZUserAccountKey, eZUserDiscountRule, eZUserSetting, eZVatRule, eZVatType, eZViewCounter, eZWaitUntilDateValue, eZWishList, eZWorkflow, eZWorkflowEvent, eZWorkflowGroup, eZWorkflowGroupLink, and eZWorkflowProcess.

Public Member Functions

 attribute ($attr, $noFunction=false)
 Returns the attribute data for $attr, this is either returned from the member variables or a member function depending on whether the definition field or function attributes matched. More...
 
 attributes ()
 Returns the attributes for this object, taken from the definition fields and function attributes. More...
 
 eZPersistentObject ($row)
 Initializes the object with the $row. More...
 
 fill ($row)
 Tries to fill in the data in the object by using the object definition which is returned by the function definition() and the database row data $row. More...
 
 hasAttribute ($attr)
 Checks if $attr is part of the definition fields or function attributes. More...
 
 hasDirtyData ()
 Returns true if the data is considered dirty and needs to be stored. More...
 
 remove ($conditions=null, $extraConditions=null)
 Removes the object from the database, it will use the keys in the object definition to figure out which table row should be removed unless $conditions is defined as an array with fieldnames. More...
 
 setAttribute ($attr, $val)
 Sets the attribute $attr to the value $val. More...
 
 setHasDirtyData ($hasDirtyData)
 Sets whether the object has dirty data or not. More...
 
 store ($fieldFilters=null)
 Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it. More...
 
 sync ($fieldFilters=null)
 Makes sure data is stored if the data is considered dirty. More...
 

Static Public Member Functions

static conditionText ($conditions)
 Calls conditionTextByRow with an empty row and $conditions. More...
 
static conditionTextByRow ($conditions, $row)
 Generates an SQL sentence from the conditions $conditions and row data $row. More...
 
static count ($def, $conds=null, $field=null)
 Fetches the number of rows by using the object definition. More...
 
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array. More...
 
static escapeArray ($array)
 Escapes strings in an array with the help of eZDBInterface::escapeString(). More...
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 Fetches and returns an object based on the given parameters and returns is either as an object or as an array. More...
 
static fetchObjectList ($def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
 Creates an SQL query out of the different parameters and returns an array with the result. More...
 
static getShortAttributeName ($db, $def, $attrName)
 Returns the short attribute name (alias) if it's defined, given attribute name otherwise. More...
 
static handleRows ($rows, $class_name, $asObject)
 Creates PHP objects out of the database rows $rows. More...
 
static newObjectOrder ($def, $orderField, $conditions)
 Returns an order value which can be used for new items in table, for instance placement. More...
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 Deletes the object from the table defined in $def with conditions $conditions and extra conditions $extraConditions. More...
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 Moves a row in a database table. More...
 
static replaceFieldsWithShortNames ($db, $fieldDefs, &$fields)
 For the given array $fields treats its keys (for associative array) or values (for non-associative array) as table fields names and replaces them with short names (aliases) found in $fieldDefs. More...
 
static storeObject ($obj, $fieldFilters=null)
 Stores the data in $obj to database. More...
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 Sets row id $id2 to have the placement of row id $id1. More...
 
static updateObjectList ($parameters)
 Updates rows matching the given parameters. More...
 

Public Attributes

 $PersistentDataDirty
 

Member Function Documentation

eZPersistentObject::attribute (   $attr,
  $noFunction = false 
)

Returns the attribute data for $attr, this is either returned from the member variables or a member function depending on whether the definition field or function attributes matched.

Parameters
string$attr
bool$noFunction
Returns
mixed

Referenced by eZPolicy\accessArray(), eZRole\accessArray(), eZRole\accessArrayByUserID(), eZOrder\activate(), eZContentObjectTreeNode\addChild(), eZNotificationCollection\addItem(), eZContentObject\addLocation(), eZContentObjectTreeNode\adjustPathElement(), eZContentObject\allowedAssignSectionList(), eZContentObject\allowedAssignStateIDList(), eZContentObject\allowedAssignStateList(), eZPolicyLimitation\allValues(), eZPolicyLimitation\allValuesAsArrayWithNames(), eZPolicyLimitation\allValuesAsString(), eZContentClassGroup\appendClass(), eZSection\applyTo(), eZPaymentObject\approved(), eZURLWildcard\asArray(), eZContentObject\assignedNodes(), eZContentObject\assignState(), eZContentObjectVersion\assignToNode(), eZRole\assignToUser(), eZWorkflowEvent\attribute(), eZProductCollectionItem\calculatePriceWithOptions(), eZUser\canAssignSectionToObject(), eZUser\canAssignToObjectSectionList(), eZSection\canBeRemoved(), eZContentObject\canEdit(), eZOrder\canModifyStatus(), eZContentObject\canTranslate(), eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZContentObjectTreeNode\childrenByName(), eZWaitUntilDateValue\classAttributeName(), eZContentObject\classListFromPolicy(), eZContentObjectTreeNode\classListFromPolicy(), eZWaitUntilDateValue\className(), eZWorkflow\cleanupWorkFlowProcess(), eZContentObjectTreeNode\clearViewCacheForSubtree(), eZNodeAssignment\cloneNodeAssignment(), eZContentObjectAttribute\collectInformation(), eZContentObject\contentActionList(), eZInformationCollectionAttribute\contentClassAttribute(), eZInformationCollectionAttribute\contentObject(), eZContentObjectVersion\contentObject(), eZInformationCollectionAttribute\contentObjectAttribute(), eZNodeviewfunctions\contentViewGenerate(), eZPolicyLimitationValue\copy(), eZRole\copy(), eZPolicyLimitation\copy(), eZPolicy\copy(), eZContentObject\copy(), eZRole\copyPolicies(), eZContentObject\copyVersion(), eZPDFExport\countGeneratingOnceExports(), eZVatRule\country(), eZContentObject\createInitialVersion(), eZContentObject\createNewVersion(), eZContentObject\createNodeAssignment(), eZCollaborationItem\createNotificationEvent(), eZBasket\createOrder(), eZPolicy\createTemporaryCopy(), eZRole\createTemporaryVersion(), eZInformationCollection\creator(), eZOrder\currencyCode(), eZContentObject\currentVersion(), eZContentObjectTreeNode\dataMap(), eZPDFExport\exportClassesArray(), eZNotificationEvent\eZNotificationEvent(), eZUser\failedLoginAttempts(), eZTrigger\fetchAllowedWorkflows(), eZContentObject\fetchClassAttributes(), eZContentObject\fetchDataMap(), ezpRestAuthorizedClient\fetchForClientUser(), eZContentClass\fetchGroupIDList(), eZContentClass\fetchGroupList(), eZRSSExport\fetchImageURL(), eZContentClass\fetchMatchGroupIDList(), eZContentBrowseBookmark\fetchNode(), eZContentBrowseRecent\fetchNode(), eZContentObjectTreeNode\fetchParent(), eZContentObjectTreeNode\fetchPath(), eZURLAliasML\fetchPathByActionList(), eZPDFExport\filepath(), ezpContent\fromObject(), eZUser\generateAccessArray(), eZRSSExport\generateFeed(), eZNodeviewfunctions\generateNodeViewData(), eZContentObjectTreeNode\getName(), eZNodeAssignment\getParentNode(), eZNodeAssignment\getParentObject(), eZUser\groups(), eZCollaborationItem\handler(), eZContentObjectVersion\hasConflicts(), eZContentObjectTreeNode\hasCurrentSubtreeLimitation(), eZUser\hasStoredLogin(), eZContentObjectTreeNode\hideSubTree(), eZRSSImport\importDescription(), eZViewCounter\increase(), eZContentClass\inGroup(), eZWorkflow\ingroupIDList(), eZWorkflow\ingroupList(), eZContentClassAttribute\initializeObjectAttributes(), eZContentClassAttribute\instantiate(), eZContentClass\instantiate(), eZContentClassAttribute\instantiateTemporary(), eZCurrencyData\isActive(), ezpContentPublishingProcess\isAlive(), eZContentObject\isAlwaysAvailable(), eZUser\isAnonymous(), eZBinaryFileType\isDeletingFile(), eZUser\isEnabled(), eZUser\isLocked(), ezpContentPublishingProcess\isProcessing(), eZContentObjectStateLanguage\isValid(), eZContentObjectStateGroupLanguage\isValid(), eZNotificationCollection\itemCount(), eZNotificationCollection\items(), eZBasket\itemsInfo(), eZNotificationCollection\itemsToSend(), eZContentObjectVersion\languageMask(), eZPolicyLimitation\limitArray(), eZPolicy\limitationList(), eZUser\limitList(), eZOperationMemento\mainMemento(), eZContentObject\mainNode(), eZContentObject\mainNodeID(), eZContentObjectVersion\mainParentNodeID(), eZBinaryFile\mimeTypeCategory(), eZMedia\mimeTypeCategory(), eZBinaryFile\mimeTypePart(), eZMedia\mimeTypePart(), eZContentObjectVersion\name(), eZContentObject\name(), eZContentObject\names(), eZSubtreeNotificationRule\node(), eZContentObjectVersion\nodeAssignments(), eZContentObjectVersion\nonTranslatableAttributesToUpdate(), eZContentObjectTreeNode\object(), eZProductCollectionItem\optionList(), eZOrder\orderItems(), eZContentObjectTrashNode\originalParent(), eZContentObjectTrashNode\originalParentPathIdentificationString(), eZWorkflowProcess\parameterList(), eZContentObjectVersion\parentNodes(), eZContentObjectTreeNode\pathArray(), eZContentObjectTreeNode\pathWithNames(), eZPolicyLimitation\policy(), eZRole\policyList(), eZOrderItem\priceExVAT(), eZOrderItem\priceIncVAT(), eZVatRule\productCategoriesIDs(), eZVatRule\productCategoriesNames(), eZVatRule\productCategoriesString(), eZOrder\productCollection(), eZBasket\productCollection(), eZNodeAssignment\purge(), eZContentObject\purge(), eZCache\purgeImageAliasForObject(), ezpContentPublishingProcess\queue(), eZCurrencyData\rateValue(), eZContentObjectVersion\relatedContentObjectArray(), eZContentObjectTreeNode\remoteID(), eZContentClass\remoteID(), eZContentObject\remoteID(), eZContentClass\removableInformation(), eZPDFExport\remove(), remove(), eZContentObjectVersion\removeAssignment(), eZOrder\removeCollection(), eZBasket\removeItem(), eZContentObjectTreeNode\removeNodeFromTree(), eZRole\removePolicies(), eZProductCollectionItem\removeThis(), eZPolicyLimitation\removeThis(), eZPolicy\removeThis(), eZRole\removeThis(), eZContentClassAttribute\removeThis(), eZWorkflowProcess\removeThis(), eZContentObjectVersion\removeThis(), eZContentObject\removeThis(), eZContentObjectTreeNode\removeThis(), eZContentObjectVersion\removeTranslation(), eZContentClass\removeTranslation(), eZContentObject\removeTranslation(), eZContentObject\rename(), eZContentObject\restoreObjectAttributes(), eZContentObjectVersion\reverseRelatedObjectList(), eZRole\revertFromTemporaryVersion(), eZUser\roleIDList(), eZUser\roles(), eZRSSExport\rssXmlContent(), eZWorkflowProcess\run(), eZPolicy\saveTemporary(), eZContentObject\sectionIdentifier(), eZContentObjectVersion\serialize(), eZContentObject\serialize(), eZContentObjectTreeNode\serialize(), eZContentClass\setAlwaysAvailableLanguageID(), eZContentObjectVersion\setAlwaysAvailableLanguageID(), eZContentObject\setAlwaysAvailableLanguageID(), eZCollaborationItem\setIsActive(), eZRSSEditFunction\setItemDefaults(), eZCollaborationItem\setLastRead(), eZContentObject\setName(), eZContentClass\setName(), eZWorkflowProcess\setParameters(), eZContentObjectTreeNode\sortArray(), eZContentObjectStateGroup\stateByIdentifier(), eZOrder\statusModificationList(), eZContentClassEditHandler\store(), eZRSSExport\store(), eZPDFExport\store(), eZVatRule\store(), eZUser\store(), eZContentClassAttribute\store(), eZContentObjectVersion\store(), eZBinaryFile\storedFileInfo(), eZMedia\storedFileInfo(), eZContentObjectTrashNode\storeToTrash(), eZContentClassAttribute\storeVersioned(), eZContentClass\storeVersioned(), eZContentObjectTreeNode\subTree(), eZContentObjectTreeNode\subTreeCount(), eZContentObjectTreeNode\subtreeSoleNodeCount(), eZContentObjectVersion\tempMainNode(), eZNodeAssignment\tempNode(), eZContentObjectAttribute\translateTo(), eZBasket\type(), eZContentObjectTreeNode\unhideSubTree(), eZContentObjectVersion\unpublish(), eZContentFunctions\updateAndPublishObject(), eZContentObjectTreeNode\updateAndStoreModified(), eZContentObjectTreeNode\updatePathIdentificationString(), eZBasket\updatePrices(), eZContentObjectTreeNode\updateSubTreePath(), eZCollaborationNotificationRule\user(), eZPolicyLimitation\valueList(), eZVatRule\vatTypeName(), eZVatRule\vatTypeObject(), eZProductCollectionItem\verify(), ezpContentPublishingProcess\version(), eZContentObject\versionLanguageName(), eZContentObjectVersion\versionName(), and eZContentObjectTreeNode\viewCount().

eZPersistentObject::attributes ( )

Returns the attributes for this object, taken from the definition fields and function attributes.

See Also
eZPersistentObject::definition()
Returns
array

Referenced by eZWorkflowEvent\attributes().

static eZPersistentObject::conditionText (   $conditions)
static

Calls conditionTextByRow with an empty row and $conditions.

Parameters
array$conditions
Returns
string

Referenced by fetchObjectList(), newObjectOrder(), removeObject(), and storeObject().

static eZPersistentObject::conditionTextByRow (   $conditions,
  $row 
)
static

Generates an SQL sentence from the conditions $conditions and row data $row.

If $row is empty (or null) it uses the condition data instead of row data.

Parameters
array$conditions
array | null$row
Returns
string

Referenced by conditionText(), and reorderObject().

static eZPersistentObject::count (   $def,
  $conds = null,
  $field = null 
)
static

Fetches the number of rows by using the object definition.

Uses fetchObjectList for the actual SQL handling. See eZPersistentObject::fetchObjectList() for a full description of the input parameters.

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
array | null$conds
string | null$field
Returns
int

Referenced by eZContentLanguage\addLanguage(), eZContentObjectTreeNode\adjustPathElement(), eZContentObject\allowedAssignStateIDList(), eZPolicyLimitation\allValuesAsArrayWithNames(), eZContentObject\appendInputRelationList(), eZRole\appendPolicy(), eZContentObjectTreeNode\assignSectionToSubTree(), eZRole\assignToUser(), eZProductCollectionItem\calculatePriceWithOptions(), eZContentObjectTreeNode\calendar(), eZSection\canBeRemoved(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentClass\canInstantiateClassList(), eZMultiPriceData\changeCurrency(), eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZContentObject\checkGroupLimitationAccess(), eZSubtreeNotificationRule\checkObjectAccess(), eZContentClassClassGroup\classInGroup(), eZContentObject\className(), eZWishList\cleanup(), eZBasket\cleanup(), eZOrder\cleanup(), eZRole\cleanupByNode(), eZBasket\cleanupExpired(), eZProductCollectionItem\cleanupList(), eZOrder\cleanupOrder(), eZContentObject\clearCache(), eZContentObjectTreeNode\clearViewCacheForSubtree(), conditionTextByRow(), eZContentObjectTreeNode\createAttributeFilterSQLStrings(), eZContentObjectTreeNode\createClassFilteringSQLString(), eZContentObjectTreeNode\createExtendedAttributeFilterSQLStrings(), eZContentBrowseRecent\createNew(), eZContentObject\createNewVersion(), eZContentObjectTreeNode\createNodesConditionSQLStringFromPath(), eZUser\createPassword(), eZContentObjectTreeNode\createPathConditionAndNotEqParentSQLStrings(), eZContentObjectTreeNode\createPermissionCheckingSQL(), eZMultiPriceData\createPriceListForCurrency(), eZContentObjectTreeNode\createSortingSQLStrings(), eZURLWildcard\createWildcardsIndex(), eZBasket\currentBasket(), eZWishList\currentWishList(), eZOrder\customerList(), eZRSSImport\destinationPath(), eZContentObject\exists(), eZContentClass\exists(), eZISBNGroupRange\extractGroup(), eZISBNRegistrantRange\extractRegistrant(), eZMultiPriceData\fetch(), eZCurrencyData\fetch(), eZContentObject\fetch(), eZContentClass\fetch(), eZContentObjectTreeNode\fetch(), eZContentObjectTreeNode\fetchAliasesFromNodeList(), eZContentClass\fetchAttributeByIdentifier(), eZContentObject\fetchAttributesByIdentifier(), eZPendingActions\fetchByAction(), eZURLAliasML\fetchByAction(), eZISBNGroup\fetchByGroup(), eZContentObjectStateGroup\fetchById(), eZContentObjectState\fetchById(), eZContentObjectStateGroup\fetchByIdentifier(), eZContentObjectState\fetchByIdentifier(), eZContentClass\fetchByIdentifier(), eZURLAliasML\fetchByPath(), eZContentObject\fetchByRemoteID(), eZContentClass\fetchByRemoteID(), eZRole\fetchByUser(), eZInformationCollection\fetchCollectionsList(), eZWorkflow\fetchEventIndexed(), eZImageFile\fetchImageAttributesByFilepath(), eZContentClassName\fetchList(), eZCurrencyData\fetchList(), eZCollaborationItem\fetchListTool(), eZContentObjectTreeNode\fetchNode(), eZURLAliasML\fetchNodeIDByPath(), eZRSSExportItem\fetchNodeList(), fetchObjectList(), eZURLAliasML\fetchPathByActionList(), eZContentObjectVersion\fetchUserDraft(), eZUser\fetchUserGroupClassNames(), eZSubtreeNotificationRule\fetchUserList(), eZContentObject\fillNodeListAttributes(), eZPolicyLimitation\findByType(), eZContentObjectTreeNode\findMainNode(), eZURLAliasML\findUniqueText(), eZContentObject\fixReverseRelations(), eZRSSExport\generateFeed(), eZRSSExportItem\getAttributeMappings(), eZContentObjectTreeNode\getName(), eZLDAPUser\getNodeAssignmentsForGroupName(), eZPathElement\getPath(), eZURLAliasML\getPath(), eZPathElement\getPathArray(), eZInformationCollection\getSortArrayFromParam(), eZLDAPUser\goAndPublishGroups(), eZURL\handleList(), eZContentObjectVersion\hasConflicts(), eZContentObject\hasRemainingVersions(), eZRSSExport\imagePath(), eZBasket\isEmpty(), eZContentClass\isRemovable(), eZURLAliasML\languageScore(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), eZContentObjectTreeNode\move(), newObjectOrder(), eZOrder\orderInfo(), eZOrder\orderTotalExVAT(), eZOrder\orderTotalIncVAT(), eZContentObjectTrashNode\originalParent(), eZContentObjectTreeNode\pathWithNames(), eZContentObject\previousVersion(), eZContentLanguage\prioritizedLanguagesByLocaleList(), eZOrder\productList(), eZLDAPUser\publishNewUserGroup(), eZLDAPUser\publishUpdateUser(), eZContentObject\purge(), eZNodeAssignment\purgeByID(), eZContentObject\relatedObjectCount(), eZContentObject\relatedObjects(), eZContentClass\removableInformation(), eZNodeAssignment\removeByID(), eZURLWildcard\removeByIDs(), eZPolicyLimitationValue\removeByValue(), eZCurrencyData\removeCurrencyList(), eZContentObjectTreeNode\removeNodeFromTree(), eZRole\removePolicy(), eZMultiPriceData\removePriceListForCurrency(), eZObjectRelationListType\removeRelationObject(), eZURLAliasML\removeSingleEntry(), eZContentObjectStateGroup\removeStatesByID(), eZContentObjectTreeNode\removeSubtrees(), eZContentObject\removeThis(), eZContentObjectVersion\removeVersions(), eZContentObject\rename(), reorderObject(), eZVatType\resetToDefaultInProducts(), eZURLAliasML\reverseTranslate(), eZRole\roleCount(), ezpNativeUserAuthFilter\run(), eZTrigger\runTrigger(), eZContentObjectVersion\serialize(), eZNodeAssignment\setNewMainAssignment(), eZRSSExportItem\sourcePath(), eZContentLanguage\sqlFilter(), eZOrder\statusModificationList(), eZContentObjectState\store(), storeObject(), eZURLAliasML\storePath(), eZContentClass\storeVersioned(), eZCollaborationGroup\subTree(), eZContentObjectTreeNode\subTreeByNodeID(), eZContentObjectTreeNode\subTreeCountByNodeID(), eZContentObjectTreeNode\subTreeMultiPaths(), eZContentObjectTreeNode\subtreeSoleNodeCount(), eZContentObjectVersion\tempMainNode(), eZContentLanguage\topPriorityLanguageByLocaleList(), eZURLAliasML\translate(), eZBasket\type(), eZContentObjectVersion\unpublish(), eZContentObjectVersion\unserialize(), eZContentObjectTreeNode\updateAndStoreModified(), eZMultiPriceData\updateAutoprices(), eZContentObjectTreeNode\updateSubTreePath(), eZURL\url(), eZURL\urlByMD5(), eZURL\urlByURL(), and eZContentObject\versionLanguageName().

static eZPersistentObject::definition ( )
static

Returns the definition for the object, the default implementation is to return an empty array.

It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

  • fields: an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
  • keys: an array of fields which is used for uniquely identifying the object in the table.
  • function_attributes: an associative array of attributes which maps to member functions, used for fetching data with functions.
  • set_functions: an associative array of attributes which maps to member functions, used for setting data with functions.
  • increment_key: the field which is incremented on table inserts.
  • class_name: the classname which is used for instantiating new objecs when fetching from the database.
  • sort: an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either 'asc' or 'desc'.
  • name: the name of the database table

Example: public static function definition() { return array( "fields" => array( "id" => "ID", "version" => "Version", "name" => "Name" ), "keys" => array( "id", "version" ), "function_attributes" => array( "current" => "currentVersion", "class_name" => "className" ), "increment_key" => "id", "class_name" => "eZContentClass", "sort" => array( "id" => "asc" ), "name" => "ezcontentclass" ); }

Returns
array

Referenced by attribute(), attributes(), fill(), hasAttribute(), remove(), and setAttribute().

static eZPersistentObject::escapeArray (   $array)
static

Escapes strings in an array with the help of eZDBInterface::escapeString().

Parameters
array$array
Returns
array
eZPersistentObject::eZPersistentObject (   $row)

Initializes the object with the $row.

It will try to set each field taken from the database row. Calls fill to do the job. If $row is an integer, it will try to fetch it from the database using it as the unique ID.

Parameters
int | array$row

Referenced by eZContentObjectState\__construct(), eZContentObjectStateGroupLanguage\__construct(), eZContentObjectStateLanguage\__construct(), eZContentObjectStateGroup\__construct(), eZBasket\eZBasket(), eZBinaryFile\eZBinaryFile(), eZCollaborationGroup\eZCollaborationGroup(), eZCollaborationItem\eZCollaborationItem(), eZCollaborationItemGroupLink\eZCollaborationItemGroupLink(), eZCollaborationItemMessageLink\eZCollaborationItemMessageLink(), eZCollaborationItemParticipantLink\eZCollaborationItemParticipantLink(), eZCollaborationItemStatus\eZCollaborationItemStatus(), eZCollaborationNotificationRule\eZCollaborationNotificationRule(), eZCollaborationProfile\eZCollaborationProfile(), eZCollaborationSimpleMessage\eZCollaborationSimpleMessage(), eZContentBrowseBookmark\eZContentBrowseBookmark(), eZContentBrowseRecent\eZContentBrowseRecent(), eZContentClass\eZContentClass(), eZContentClassAttribute\eZContentClassAttribute(), eZContentClassClassGroup\eZContentClassClassGroup(), eZContentClassGroup\eZContentClassGroup(), eZContentClassName\eZContentClassName(), eZContentLanguage\eZContentLanguage(), eZContentObject\eZContentObject(), eZContentObjectAttribute\eZContentObjectAttribute(), eZContentObjectTrashNode\eZContentObjectTrashNode(), eZContentObjectTreeNode\eZContentObjectTreeNode(), eZContentObjectVersion\eZContentObjectVersion(), eZCurrencyData\eZCurrencyData(), eZDiscountRule\eZDiscountRule(), eZDiscountSubRule\eZDiscountSubRule(), eZDiscountSubRuleValue\eZDiscountSubRuleValue(), eZEnumObjectValue\eZEnumObjectValue(), eZEnumValue\eZEnumValue(), eZForgotPassword\eZForgotPassword(), eZGeneralDigestUserSettings\eZGeneralDigestUserSettings(), eZImageFile\eZImageFile(), eZInformationCollection\eZInformationCollection(), eZInformationCollectionAttribute\eZInformationCollectionAttribute(), eZISBNGroup\eZISBNGroup(), eZISBNGroupRange\eZISBNGroupRange(), eZISBNRegistrantRange\eZISBNRegistrantRange(), eZMedia\eZMedia(), eZMultiPriceData\eZMultiPriceData(), eZNodeAssignment\eZNodeAssignment(), eZNotificationCollection\eZNotificationCollection(), eZNotificationCollectionItem\eZNotificationCollectionItem(), eZNotificationEvent\eZNotificationEvent(), eZOperationMemento\eZOperationMemento(), eZOrder\eZOrder(), eZOrderItem\eZOrderItem(), eZOrderStatus\eZOrderStatus(), eZOrderStatusHistory\eZOrderStatusHistory(), eZPathElement\eZPathElement(), eZPaymentObject\eZPaymentObject(), eZPDFExport\eZPDFExport(), eZPolicy\eZPolicy(), eZPolicyLimitation\eZPolicyLimitation(), eZPolicyLimitationValue\eZPolicyLimitationValue(), eZProductCategory\eZProductCategory(), eZProductCollection\eZProductCollection(), eZProductCollectionItem\eZProductCollectionItem(), eZProductCollectionItemOption\eZProductCollectionItemOption(), eZRole\eZRole(), eZRSSExport\eZRSSExport(), eZRSSExportItem\eZRSSExportItem(), eZRSSImport\eZRSSImport(), eZSection\eZSection(), eZSubtreeNotificationRule\eZSubtreeNotificationRule(), eZTipafriendCounter\eZTipafriendCounter(), eZTipafriendRequest\eZTipafriendRequest(), eZTrigger\eZTrigger(), eZURL\eZURL(), eZURLAliasML\eZURLAliasML(), eZURLObjectLink\eZURLObjectLink(), eZURLWildcard\eZURLWildcard(), eZUser\eZUser(), eZUserAccountKey\eZUserAccountKey(), eZUserDiscountRule\eZUserDiscountRule(), eZUserSetting\eZUserSetting(), eZVatRule\eZVatRule(), eZVatType\eZVatType(), eZViewCounter\eZViewCounter(), eZWaitUntilDateValue\eZWaitUntilDateValue(), eZWishList\eZWishList(), eZWorkflow\eZWorkflow(), eZWorkflowEvent\eZWorkflowEvent(), eZWorkflowGroup\eZWorkflowGroup(), eZWorkflowGroupLink\eZWorkflowGroupLink(), and eZWorkflowProcess\eZWorkflowProcess().

static eZPersistentObject::fetchObject (   $def,
  $field_filters,
  $conds,
  $asObject = true,
  $grouping = null,
  $custom_fields = null 
)
static

Fetches and returns an object based on the given parameters and returns is either as an object or as an array.

See eZPersistentObject::fetchObjectList() for a full description of the input parameters.

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
array$field_filtersIf defined determines the fields which are extracted, if not all fields are fetched
array$condsAn array of conditions which determines which rows are fetched
bool$asObjectIf true the returned item is an object otherwise a db row (array).
array | null$groupingAn array of elements to group by
array$custom_fields,|nullAn array of extra fields to fetch, each field may be a SQL operation
Returns
eZPersistentObject|array|null

Referenced by checkNodeMovements(), eZContentObjectAttribute\cloneContentObjectAttribute(), eZRSSFunctionCollection\exportByNode(), eZProductCategory\fetch(), eZDiscountRule\fetch(), eZSection\fetch(), eZTipafriendCounter\fetch(), eZOperationMemento\fetch(), eZVatRule\fetch(), eZURLObjectLink\fetch(), eZUserDiscountRule\fetch(), eZCollaborationProfile\fetch(), eZWorkflowGroup\fetch(), eZContentBrowseBookmark\fetch(), eZDiscountSubRule\fetch(), eZUserSetting\fetch(), eZContentBrowseRecent\fetch(), eZCollaborationItemStatus\fetch(), eZViewCounter\fetch(), eZVatType\fetch(), eZEnumObjectValue\fetch(), eZTrigger\fetch(), eZProductCollection\fetch(), eZWorkflowGroupLink\fetch(), eZCollaborationItemGroupLink\fetch(), eZEnumValue\fetch(), eZBinaryFile\fetch(), eZCollaborationSimpleMessage\fetch(), eZOrderStatus\fetch(), eZCollaborationItemMessageLink\fetch(), eZProductCollectionItem\fetch(), eZContentClassGroup\fetch(), eZContentClassClassGroup\fetch(), eZCollaborationItemParticipantLink\fetch(), eZWorkflowEvent\fetch(), eZWaitUntilDateValue\fetch(), eZContentObjectAttribute\fetch(), eZOrderStatusHistory\fetch(), eZCollaborationItem\fetch(), eZMedia\fetch(), eZCollaborationGroup\fetch(), eZContentObjectVersion\fetch(), eZNotificationEvent\fetch(), eZURLWildcard\fetch(), eZOrder\fetch(), eZRSSExportItem\fetch(), eZRSSImport\fetch(), eZPDFExport\fetch(), eZRSSExport\fetch(), eZURL\fetch(), eZUser\fetch(), eZBasket\fetch(), eZWorkflow\fetch(), eZPolicy\fetch(), eZContentClassAttribute\fetch(), eZInformationCollection\fetch(), eZNodeAssignment\fetch(), eZWorkflowProcess\fetch(), eZRole\fetch(), eZContentObjectAttribute\fetchByClassAttributeID(), eZUser\fetchByEmail(), eZBinaryFile\fetchByFileName(), eZMedia\fetchByFileName(), eZImageFile\fetchByFilepath(), eZPaymentObject\fetchByID(), eZNodeAssignment\fetchByID(), eZSection\fetchByIdentifier(), eZPolicyLimitation\fetchByIdentifier(), eZContentObjectAttribute\fetchByIdentifier(), eZForgotPassword\fetchByKey(), eZUserAccountKey\fetchByKey(), eZProductCategory\fetchByName(), eZContentClassGroup\fetchByName(), eZRSSExport\fetchByName(), eZUser\fetchByName(), eZRole\fetchByName(), eZInformationCollectionAttribute\fetchByObjectAttributeID(), eZPaymentObject\fetchByOrderID(), eZPaymentObject\fetchByProcessID(), eZURLWildcard\fetchBySourceURL(), eZOrderStatus\fetchByStatus(), eZCollaborationProfile\fetchByUser(), eZUserAccountKey\fetchByUserID(), eZGeneralDigestUserSettings\fetchByUserId(), eZInformationCollection\fetchByUserIdentifier(), eZOperationMemento\fetchChild(), eZNotificationCollection\fetchForHandler(), eZOperationMemento\fetchMain(), eZPolicy\fetchTemporaryCopy(), importRSSItem(), eZContentObjectPackageHandler\installSuspendedNodeAssignment(), eZContentObjectAttribute\language(), eZNodeAssignment\remove(), eZContentOperationCollection\removeFeedForNode(), eZPolicy\role(), eZTrigger\runTrigger(), and eZContentObjectTreeNode\unserialize().

static eZPersistentObject::fetchObjectList (   $def,
  $field_filters = null,
  $conds = null,
  $sorts = null,
  $limit = null,
  $asObject = true,
  $grouping = false,
  $custom_fields = null,
  $custom_tables = null,
  $custom_conds = null 
)
static

Creates an SQL query out of the different parameters and returns an array with the result.

A full example: $filter = array( 'id', 'name' ); $conds = array( 'type' => 5, 'size' => array( false, array( 200, 500 ) ) ); $sorts = array( 'name' => 'asc' ); $limit = array( 'offset' => 50, 'length' => 10 ); eZPersistentObject::fetchObjectList( $def, $filter, $conds, $sorts, $limit, true, false, null )

Counting number of elements. $custom = array( array( 'operation' => 'count( id )', 'name' => 'count' ) ); // Here $field_filters is set to an empty array, that way only count is used in fields $rows = eZPersistentObject::fetchObjectList( $def, array(), null, null, null, false, false, $custom ); return $rows[0]['count'];

Counting elements per type using grouping $custom = array( array( 'operation' => 'count( id )', 'name' => 'count' ) ); $group = array( 'type' ); $rows = eZPersistentObject::fetchObjectList( $def, array(), null, null, null, false, $group, $custom ); return $rows[0]['count'];

Example to fetch a result with custom conditions. The following example will fetch the attributes to the contentobject with id 1 and add the contentobject.name in each attribute row with the array key contentobject_name. $objectDef = eZContentObject::definition(); $objectAttributeDef = eZContentObjectAttribute::definition();

$fields = array(); $conds = array( $objectDef['name'] . '.id' => 1 ); $sorts = array( $objectAttributeDef['name'] . '.sort_key_string' => 'asc' );

$limit = null; $asObject = false; $group = false;

$customFields = array( $objectAttributeDef['name'] . '.*', array( 'operation' => $objectDef['name'] . '.name', 'name' => 'contentobject_name' ) );

$customTables = array( $objectDef['name'] );

$languageCode = 'eng-GB'; $customConds = ' AND ' . $objectDef['name'] . '.current_version=' . $objectAttributeDef['name'] . '.version' . ' AND ' . $objectDef['name'] . '.id=' . $objectAttributeDef['name'] . '.contentobject_id' . ' AND ' . $objectAttributeDef['name'] . '.language_code=\'' . $languageCode . '\'';

$rows = eZPersistentObject::fetchObjectList( $objectAttributeDef, $fields, $conds, $sorts, $limit, $asObject, $group, $customFields, $customTables, $customConds );

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
array | null$field_filtersIf defined determines the fields which are extracted (array of field names), if not all fields are fetched
array | null$condsnull for no special condition or an associative array of fields to filter on. Syntax is FIELD => CONDITION CONDITION can be one of:
  • Scalar value: Creates a condition where FIELD must match the value, e.g array( 'id' => 5 ) generates SQL id = 5
  • Array with two scalar values: The first value is the match operator, the second is the scalar value array( 'priority' => array( '>', 5 ) ) generates SQL priority > 5
  • Array with range: The first value is false, the second value is an array with start and stop of range in array array( 'type' => array( false, array( 1, 5 ) ) ) generates SQL type BETWEEN 1 AND 5
  • Array with multiple elements: The first value is the field identifier, the second is an array with scalar values array( 'id' => array( array( 1, 5, 7 ) ) ) generates SQL id IN ( 1, 5, 7 )
array | null | bool$sortsAn associative array of sorting conditions, if set to false ignores settings in $def, if set to null uses settingss in $def. Syntax is FIELD => DIRECTION. DIRECTION must either be 'asc' for ascending or 'desc' for descending.
array | null$limitAn associative array with limitiations, can contain
  • 'offset': Numerical value defining the start offset for the fetch
  • 'length': Numerical value defining the max number of items to return
bool$asObjectIf true then it will return an array with objects, objects are created from class defined in $def. If falseit will just return the rows fetch from database.
array | null | bool$groupingAn array of fields to group by or null to use grouping in defintion $def.
null$custom_fieldsArray of FIELD elements to add to SQL, can be used to perform custom fetches, e.g counts. FIELD is an associative array containing:
  • 'operation': A text field which is included in the field list
  • 'name': If present it adds AS name to the operation.
array | null$custom_tablesArray of additional tables
string | null$custom_condsString with sql conditions for 'WHERE' clause.
Returns
eZPersistentObject[]|array|null An array of objects or rows, null on error

Referenced by eZOrder\active(), eZOrder\activeByUserID(), eZContentObject\allContentObjectAttributes(), eZMultiplexerType\attribute(), eZSection\canBeRemoved(), eZSSLZone\checkNodeID(), eZSSLZone\checkObject(), eZContentClassClassGroup\classInGroup(), eZURLObjectLink\clearCacheForObjectLink(), copySubtree(), count(), eZPDFExport\countGeneratingOnceExports(), eZContentBrowseRecent\createNew(), eZBasket\currentBasket(), eZWishList\currentWishList(), eZContentObjectState\defaults(), eZContentClass\exists(), eZISBNGroupRange\extractGroup(), eZISBNRegistrantRange\extractRegistrant(), eZMultiPriceData\fetch(), eZBinaryFile\fetch(), eZMedia\fetch(), eZContentClass\fetch(), eZRSSImport\fetchActiveList(), eZUserSetting\fetchAll(), eZEnumObjectValue\fetchAllElements(), eZEnumValue\fetchAllElements(), eZWaitUntilDateValue\fetchAllElements(), eZContentObjectAttribute\fetchAttributeTranslations(), eZShopFunctionCollection\fetchBasket(), eZMedia\fetchByContentObjectID(), eZContentObjectTreeNode\fetchByContentObjectID(), eZNotificationCollectionItem\fetchByDate(), eZBinaryFile\fetchByFileName(), eZMedia\fetchByFileName(), eZContentObjectStateGroupLanguage\fetchByGroup(), eZISBNGroup\fetchByGroup(), eZContentClass\fetchByIdentifier(), eZSection\fetchByOffset(), eZRole\fetchByOffset(), eZPolicyLimitation\fetchByPolicyID(), eZContentClass\fetchByRemoteID(), eZDiscountSubRule\fetchByRuleID(), eZUserDiscountRule\fetchByRuleID(), eZContentObjectStateLanguage\fetchByState(), eZDiscountSubRuleValue\fetchBySubRuleID(), eZUserDiscountRule\fetchByUserID(), eZVatRule\fetchByVatType(), eZContentClassClassGroup\fetchClassListByGroups(), eZInformationCollection\fetchCollectionsCount(), eZInformationCollection\fetchCollectionsList(), eZVatRule\fetchCountByVatType(), eZNotificationCollectionItem\fetchCountForEvent(), eZContentFunctionCollection\fetchDraftVersionCount(), eZContentFunctionCollection\fetchDraftVersionList(), eZWorkflow\fetchEventCount(), eZWorkflow\fetchEventCountByWorkflowID(), eZWorkflow\fetchEventIndexed(), eZContentObjectVersion\fetchFiltered(), eZSection\fetchFilteredList(), eZWorkflowEvent\fetchFilteredList(), eZRSSExportItem\fetchFilteredList(), eZContentClassAttribute\fetchFilteredList(), eZContentObject\fetchFilteredList(), eZWorkflowProcess\fetchForContent(), eZImageFile\fetchForContentObjectAttribute(), eZNodeAssignment\fetchForObject(), eZWorkflowProcess\fetchForSession(), eZWorkflowProcess\fetchForStatus(), eZContentObjectVersion\fetchForUser(), eZWorkflowGroupLink\fetchGroupList(), eZContentClassClassGroup\fetchGroupList(), eZImageFile\fetchImageAttributesByFilepath(), eZCollaborationItemMessageLink\fetchItemCount(), eZCollaborationItemMessageLink\fetchItemList(), eZCollaborationNotificationRule\fetchItemTypeList(), eZContentObjectVersion\fetchLatestUserDraft(), eZURLObjectLink\fetchLinkList(), eZDiscountRule\fetchList(), eZContentClassName\fetchList(), eZProductCategory\fetchList(), eZDiscountSubRuleValue\fetchList(), eZCollaborationNotificationRule\fetchList(), eZOrderItem\fetchList(), eZCurrencyData\fetchList(), eZVatRule\fetchList(), eZWorkflowGroup\fetchList(), eZDiscountSubRule\fetchList(), eZSubtreeNotificationRule\fetchList(), eZISBNGroup\fetchList(), eZPolicyLimitationValue\fetchList(), eZTrigger\fetchList(), eZVatType\fetchList(), eZOperationMemento\fetchList(), eZISBNGroupRange\fetchList(), eZCollaborationItemGroupLink\fetchList(), eZProductCollectionItemOption\fetchList(), eZProductCollectionItem\fetchList(), eZContentClassGroup\fetchList(), eZWorkflowEvent\fetchList(), eZSection\fetchList(), eZNotificationEvent\fetchList(), eZContentLanguage\fetchList(), eZOrder\fetchList(), eZOrderStatus\fetchList(), eZURLWildcard\fetchList(), eZRSSImport\fetchList(), eZPDFExport\fetchList(), eZRSSExport\fetchList(), eZWorkflow\fetchList(), eZContentClassAttribute\fetchList(), eZWorkflowProcess\fetchList(), eZRole\fetchList(), eZContentObject\fetchList(), eZContentClass\fetchList(), eZContentObjectAttribute\fetchListByClassID(), eZContentClassAttribute\fetchListByClassID(), eZISBNRegistrantRange\fetchListByGroupID(), eZNodeAssignment\fetchListByID(), eZWorkflowProcess\fetchListByKey(), eZOrderItem\fetchListByType(), eZSubtreeNotificationRule\fetchListCount(), eZCurrencyData\fetchListCount(), eZURLWildcard\fetchListCount(), eZWorkflow\fetchListCount(), eZContentObject\fetchListCount(), eZNotificationCollection\fetchListForHandler(), eZContentBrowseBookmark\fetchListForUser(), eZContentBrowseRecent\fetchListForUser(), eZOrderStatus\fetchMap(), eZSubtreeNotificationRule\fetchNodesForUserID(), fetchObject(), eZSectionFunctionCollection\fetchObjectList(), eZSectionFunctionCollection\fetchObjectListCount(), eZURLObjectLink\fetchObjectVersionCount(), eZURLObjectLink\fetchObjectVersionList(), eZOrderStatus\fetchOrderedList(), eZCollaborationItemParticipantLink\fetchParticipantList(), eZContentFunctionCollection\fetchPendingCount(), eZContentFunctionCollection\fetchPendingList(), eZContentObjectAttribute\fetchSameClassAttributeIDList(), eZContentObject\fetchSameClassListCount(), eZContentFunctionCollection\fetchTipafriendTopList(), eZViewCounter\fetchTopList(), eZUser\fetchUnactivated(), eZNotificationEvent\fetchUnhandledList(), eZContentObjectVersion\fetchUserDraft(), eZUserDiscountRule\fetchUserID(), eZWorkflowProcess\fetchUserList(), eZGeneralDigestHandler\fetchUsersForDigest(), eZContentObjectVersion\fetchVersion(), eZContentFunctionCollection\fetchVersionCount(), eZContentFunctionCollection\fetchVersionList(), eZWorkflowGroupLink\fetchWorkflowList(), eZURL\handleList(), eZWishList\itemCount(), eZNotificationCollection\itemCount(), eZProductCollection\itemList(), eZBasket\items(), eZNotificationCollection\items(), eZWishList\items(), eZNotificationCollection\itemsToSend(), eZPolicy\limitationList(), ezpContentPublishingQueue\next(), eZRole\policyList(), eZOrder\productItems(), eZObjectRelationListType\removeRelationObject(), reorderObject(), eZImageType\restoreTrashedObjectAttribute(), storeObject(), eZImageType\trashStoredObjectAttribute(), eZISBN10To13Converter\updateContentFromClassAttribute(), eZPolicyLimitation\valueList(), eZProductCollection\verify(), and eZContentObject\versions().

eZPersistentObject::fill (   $row)

Tries to fill in the data in the object by using the object definition which is returned by the function definition() and the database row data $row.

Each field will be fetch from the definition and then use that fieldname to fetch from the row and set the data.

Todo:
Change the actual access to protected instead of just marking it as such protected
Parameters
array$row
Returns
bool

Referenced by eZPersistentObject().

static eZPersistentObject::getShortAttributeName (   $db,
  $def,
  $attrName 
)
static

Returns the short attribute name (alias) if it's defined, given attribute name otherwise.

Parameters
eZDBInterface$db
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
string$attrName
Returns
string

Referenced by eZURL\handleList().

static eZPersistentObject::handleRows (   $rows,
  $class_name,
  $asObject 
)
static
eZPersistentObject::hasAttribute (   $attr)

Checks if $attr is part of the definition fields or function attributes.

Parameters
string$attr
Returns
bool

Referenced by eZWorkflowEvent\hasAttribute(), and eZWorkflowProcess\run().

eZPersistentObject::hasDirtyData ( )

Returns true if the data is considered dirty and needs to be stored.

Returns
bool

Referenced by sync(), and eZContentClass\sync().

static eZPersistentObject::newObjectOrder (   $def,
  $orderField,
  $conditions 
)
static

Returns an order value which can be used for new items in table, for instance placement.

Uses $def, $orderField and $conditions to figure out the currently maximum order value and returns one that is larger.

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
string$orderField
array$conditions
Returns
int

Referenced by eZEnumValue\create(), eZWorkflowEvent\create(), and eZContentClassAttribute\create().

eZPersistentObject::remove (   $conditions = null,
  $extraConditions = null 
)

Removes the object from the database, it will use the keys in the object definition to figure out which table row should be removed unless $conditions is defined as an array with fieldnames.

It uses removeObject to do the real job and passes the object defintion, conditions and extra conditions $extraConditions to this function.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
array | null$conditions
array | null$extraConditions
Returns
void

Referenced by eZPDFExport\remove(), eZContentClass\remove(), eZWorkflow\removeThis(), eZContentLanguage\removeThis(), eZSection\removeThis(), eZProductCollectionItem\removeThis(), eZRSSExport\removeThis(), and eZContentClassAttribute\removeThis().

static eZPersistentObject::removeObject (   $def,
  $conditions = null,
  $extraConditions = null 
)
static

Deletes the object from the table defined in $def with conditions $conditions and extra conditions $extraConditions.

The extra conditions will either be appended to the existing conditions or overwrite existing fields.

Uses conditionText() to create the condition SQL.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
array | null$conditions
array | null$extraConditions
Returns
void

Referenced by eZXMLTextType\deleteStoredObjectAttribute(), eZSubTreeHandler\fetchHttpInput(), eZGeneralDigestHandler\handle(), eZContentObject\purge(), eZDiscountSubRule\remove(), remove(), eZURLWildcard\removeAll(), eZEnumObjectValue\removeAllElements(), eZEnumValue\removeAllElements(), eZWaitUntilDateValue\removeAllElements(), eZContentClass\removeAttributes(), eZWorkflowGroupLink\removeByID(), eZDiscountRule\removeByID(), eZISBNGroup\removeByID(), eZURL\removeByID(), eZEnumValue\removeByID(), eZISBNGroupRange\removeByID(), eZProductCategory\removeByID(), eZISBNRegistrantRange\removeByID(), eZWaitUntilDateValue\removeByID(), eZMultiPriceData\removeByID(), eZBinaryFile\removeByID(), eZUserDiscountRule\removeByID(), eZMedia\removeByID(), eZContentObjectStateGroup\removeByID(), eZContentObjectState\removeByID(), eZCollaborationNotificationRule\removeByIdentifier(), eZURLWildcard\removeByIDs(), eZSubtreeNotificationRule\removeByNodeAndUserID(), eZEnumObjectValue\removeByOAID(), eZMultiPriceData\removeByOAID(), eZDiscountSubRuleValue\removeBySubRuleID(), eZForgotPassword\removeByUserID(), eZUserAccountKey\removeByUserID(), eZCollaborationNotificationRule\removeByUserID(), eZUserSetting\removeByUserID(), eZWishList\removeByUserID(), eZSubtreeNotificationRule\removeByUserID(), eZPolicyLimitationValue\removeByValue(), eZContentClassClassGroup\removeClassMembers(), eZViewCounter\removeCounter(), eZCurrencyData\removeCurrencyList(), eZNotificationCollection\removeEmpty(), eZWorkflow\removeEvents(), eZImageFile\removeForContentObjectAttribute(), eZTipafriendCounter\removeForNode(), eZContentClassClassGroup\removeGroup(), eZWorkflowGroupLink\removeGroupMembers(), eZContentClassClassGroup\removeGroupMembers(), eZWorkflowGroup\removeSelected(), eZContentClassGroup\removeSelected(), eZPolicyLimitation\removeSelected(), eZWorkflow\removeTemporary(), eZContentClass\removeTemporary(), eZWorkflow\removeThis(), eZVatType\removeThis(), eZOrderStatus\removeThis(), eZWorkflowProcess\removeThis(), eZContentObjectAttribute\removeThis(), eZURLObjectLink\removeURLlinkList(), eZUserDiscountRule\removeUser(), eZUser\removeUser(), eZVatRule\removeVatRule(), eZWorkflow\removeWorkflow(), and eZWorkflowGroupLink\removeWorkflowMembers().

static eZPersistentObject::reorderObject (   $def,
  $orderField,
  $conditions,
  $down = true 
)
static

Moves a row in a database table.

Uses $orderField to determine the order of objects in a table, usually this is a placement of some kind. It uses this order field to figure out how move the row, the row is either swapped with another row which is either above or below according to whether $down is true or false, or it is swapped with the first item or the last item depending on whether this row is first or last. Uses $conditions to figure out unique rows.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
array$defA definition array of all fields, table name and sorting (see eZPersistentObject::definition() for more info)
array$orderFieldAssociative array with one element, the key is the order id and values is order value.
array$conditions
bool$down
Returns
void

Referenced by eZWorkflowEvent\move(), and eZContentClassAttribute\move().

static eZPersistentObject::replaceFieldsWithShortNames (   $db,
  $fieldDefs,
$fields 
)
static

For the given array $fields treats its keys (for associative array) or values (for non-associative array) as table fields names and replaces them with short names (aliases) found in $fieldDefs.

Todo:
Change the actual access to protected instead of just marking it as such protected
Parameters
eZDBInterface$db
array$fieldDefs
array$fields
Returns
void

Referenced by fetchObjectList(), removeObject(), and storeObject().

eZPersistentObject::setAttribute (   $attr,
  $val 
)

Sets the attribute $attr to the value $val.

The attribute must be present in the objects definition fields or set functions.

Parameters
string$attr
mixed$val
Returns
void

Referenced by eZProductCollection\__clone(), eZProductCollectionItem\__clone(), eZProductCollectionItemOption\__clone(), eZContentObject\__clone(), eZOrder\activate(), eZPaymentObject\approve(), eZBasket\createOrder(), eZOrder\detachProductCollection(), eZContentClassAttribute\eZContentClassAttribute(), eZViewCounter\increase(), eZContentClass\initializeCopy(), ezpContentPublishingProcess\publish(), eZContentObjectTreeNode\remoteID(), eZContentClass\remoteID(), eZContentObject\remoteID(), eZContentObject\removeThis(), eZContentClass\removeTranslation(), eZContentObject\removeTranslation(), ezpContentPublishingProcess\reset(), eZRole\revertFromTemporaryVersion(), eZWorkflowProcess\run(), eZContentObject\serialize(), eZContentClass\setAlwaysAvailableLanguageID(), eZContentObject\setAlwaysAvailableLanguageID(), eZVatRule\setAttribute(), eZUserSetting\setAttribute(), eZDiscountSubRule\setAttribute(), eZPolicyLimitation\setAttribute(), eZPolicy\setAttribute(), eZURLAliasML\setAttribute(), eZRSSImport\setImportDescription(), eZUser\setInformation(), eZRSSEditFunction\setItemDefaults(), eZContentClass\setName(), eZWorkflowProcess\setParameters(), eZCurrencyData\setStatus(), eZWorkflow\setVersion(), eZContentClass\setVersion(), eZPDFExport\store(), eZRSSExport\store(), eZRSSImport\store(), eZContentObjectAttribute\store(), eZContentClassAttribute\store(), eZContentObjectStateGroup\store(), eZContentObjectState\store(), eZContentClass\store(), eZContentObjectAttribute\storeData(), eZContentClassAttribute\storeVersioned(), eZContentClass\storeVersioned(), eZContentObjectVersion\unpublish(), eZContentFunctions\updateAndPublishObject(), eZContentObjectVersion\updateLanguageMask(), eZContentObjectTreeNode\updatePathIdentificationString(), and eZContentObjectAttribute\updateSortKey().

eZPersistentObject::setHasDirtyData (   $hasDirtyData)

Sets whether the object has dirty data or not.

Parameters
bool$hasDirtyData
Returns
void

Referenced by setAttribute().

static eZPersistentObject::storeObject (   $obj,
  $fieldFilters = null 
)
static

Stores the data in $obj to database.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Todo:
Change the actual access to protected instead of just marking it as such protected
Parameters
eZPersistentObject$obj
array | null$fieldFiltersIf specified only certain fields will be stored.
Returns
void

Referenced by store(), eZContentObjectStateGroup\store(), and eZContentObjectState\store().

static eZPersistentObject::swapRow (   $table,
  $keys,
  $order_id,
  $rows,
  $id1,
  $id2 
)
static

Sets row id $id2 to have the placement of row id $id1.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
string$table
array$keys
int$order_id
array$rows
int$id1
int$id2
Returns
string

Referenced by reorderObject().

eZPersistentObject::sync (   $fieldFilters = null)

Makes sure data is stored if the data is considered dirty.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
array | null$fieldFilters
Returns
void

Referenced by eZContentObjectTreeNode\remoteID(), eZContentObject\remoteID(), and eZContentObjectTreeNode\updatePathIdentificationString().

static eZPersistentObject::updateObjectList (   $parameters)
static

Updates rows matching the given parameters.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters
array$parameters
Returns
void

Referenced by eZWorkflow\setIsEnabled(), eZURL\setIsValid(), eZURL\setLastChecked(), eZContentClassClassGroup\update(), and eZCollaborationItemStatus\updateFields().

Member Data Documentation

eZPersistentObject::$PersistentDataDirty

Referenced by hasDirtyData().


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