eZPublish  4.5
eZPersistentObject Class Reference

Allows for object persistence in a database. More...

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)
 
 attributes ()
 
 eZPersistentObject ($row)
 
 fill ($row)
 
 hasAttribute ($attr)
 
 hasDirtyData ()
 
 remove ($conditions=null, $extraConditions=null)
 
 setAttribute ($attr, $val)
 
 setHasDirtyData ($hasDirtyData)
 
 store ($fieldFilters=null)
 
 sync ($fieldFilters=null)
 

Static Public Member Functions

static conditionText ($conditions)
 
static conditionTextByRow ($conditions, $row)
 
static count ($def, $conds=null, $field=null)
 
static definition ()
 
static escapeArray ($array)
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 
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)
 
static getShortAttributeName ($db, $def, $attrName)
 
static handleRows ($rows, $class_name, $asObject)
 
static newObjectOrder ($def, $orderField, $conditions)
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 
static updateObjectList ($parameters)
 

Public Attributes

 $PersistentDataDirty
 Whether the data is dirty, ie needs to be stored, or not. More...
 

Static Private Member Functions

static replaceFieldsWithShortNames ($db, $fieldDefs, &$fields)
 
static storeObject ($obj, $fieldFilters=null)
 

Detailed Description

Allows for object persistence in a database.

Classes which stores simple types in databases should inherit from this and implement the definition() function. The class will then get initialization, fetching, listing, moving, storing and deleting for free as well as attribute access. The new class must have a constructor which takes one parameter called $row and pass that this constructor.

class MyClass extends eZPersistentObject
{
function MyClass( $row )
{
}
}

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.

Referenced by eZPolicy\accessArray(), eZRole\accessArray(), eZRole\accessArrayByUserID(), eZContentObjectTreeNode\addChild(), eZNotificationCollection\addItem(), eZContentObject\addLocation(), eZContentObjectTreeNode\adjustPathElement(), eZContentObject\allowedAssignSectionList(), eZContentObject\allowedAssignStateIDList(), eZContentObject\allowedAssignStateList(), eZPolicyLimitation\allValues(), eZPolicyLimitation\allValuesAsArrayWithNames(), eZPolicyLimitation\allValuesAsString(), eZContentClassGroup\appendClass(), 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(), eZRSSExport\fetchRSS1_0(), eZRSSExport\fetchRSS2_0(), eZPDFExport\filepath(), ezpContent\fromObject(), eZUser\generateAccessArray(), eZRSSExport\generateFeed(), eZNodeviewfunctions\generateNodeViewData(), eZContentObjectTreeNode\getName(), eZNodeAssignment\getParentNode(), eZNodeAssignment\getParentObject(), eZUser\groups(), eZCollaborationItem\handler(), eZContentObjectVersion\hasConflicts(), 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(), eZUser\isEnabled(), eZUser\isLocked(), ezpContentPublishingProcess\isProcessing(), eZContentObjectStateGroupLanguage\isValid(), eZContentObjectStateLanguage\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(), ezpContentPublishingProcess\queue(), eZCurrencyData\rateValue(), eZContentObjectVersion\relatedContentObjectArray(), eZContentObjectTreeNode\remoteID(), eZContentClass\remoteID(), eZContentObject\remoteID(), eZContentClass\removableInformation(), remove(), eZPDFExport\remove(), eZContentObjectVersion\removeAssignment(), eZOrder\removeCollection(), eZBasket\removeItem(), eZContentObjectTreeNode\removeNodeFromTree(), eZRole\removePolicies(), eZContentObject\removeReverseRelations(), 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(), eZContentObjectVersion\reverseRelatedObjectList(), eZRole\revertFromTemporaryVersion(), eZUser\roleIDList(), eZUser\roles(), eZRSSExport\rssXml(), eZRSSExport\rssXmlContent(), eZWorkflowProcess\run(), eZPolicy\saveTemporary(), 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(), eZPDFExport\store(), eZRSSExport\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.

Referenced by eZWorkflowEvent\attributes().

static eZPersistentObject::conditionText (   $conditions)
static

Calls conditionTextByRow with an empty row and $conditions.

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 (null) it uses the condition data instead of row data.

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 fetchObjectList() for a full description of the input parameters.

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(), eZRSSExport\fetchRSS1_0(), eZRSSExport\fetchRSS2_0(), eZContentObjectVersion\fetchUserDraft(), eZUser\fetchUserGroupClassNames(), eZSubtreeNotificationRule\fetchUserList(), eZContentObject\fillNodeListAttributes(), eZPolicyLimitation\findByType(), eZContentObjectTreeNode\findMainNode(), eZContentObjectTreeNode\findMainNodeArray(), eZContentObjectTreeNode\findNode(), 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\orderStatistics(), eZOrder\orderTotalExVAT(), eZOrder\orderTotalIncVAT(), eZContentObjectTrashNode\originalParent(), eZContentObjectTreeNode\pathWithNames(), eZContentObject\previousVersion(), eZContentLanguage\prioritizedLanguagesByLocaleList(), eZOrder\productList(), eZLDAPUser\publishNewUserGroup(), eZLDAPUser\publishUpdateUser(), eZContentObject\purge(), eZNodeAssignment\purgeByID(), eZURL\registerURL(), eZContentObject\relatedObjectCount(), eZContentObject\relatedObjects(), eZContentObject\remoteID(), eZContentClass\removableInformation(), eZNodeAssignment\removeByID(), eZURLWildcard\removeByIDs(), eZPolicyLimitationValue\removeByValue(), eZCurrencyData\removeCurrencyList(), eZContentObjectTreeNode\removeNodeFromTree(), eZRole\removePolicy(), eZMultiPriceData\removePriceListForCurrency(), eZContentObject\removeReverseRelations(), eZURLAliasML\removeSingleEntry(), eZContentObjectStateGroup\removeStatesByID(), eZContentObjectTreeNode\removeSubtrees(), eZContentObject\removeThis(), eZUser\removeUser(), eZContentObjectVersion\removeVersions(), eZContentObject\rename(), reorderObject(), eZVatType\resetToDefaultInProducts(), eZURLAliasML\reverseTranslate(), 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
 \return 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 \c asc or \c desc.
 - name - the name of the database table

 Example:
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" );
}

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

static eZPersistentObject::escapeArray (   $array)
static
eZPersistentObject::eZPersistentObject (   $row)

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

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

Creates an SQL query out of the different parameters and returns an object with the result. If $asObject is true the returned item is an object otherwise a db row. Uses fetchObjectList for the actual SQL handling and just returns the first row item.

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

Parameters
$defThe definition structure
$field_filtersIf defined determines the fields which are extracted, if not all fields are fetched
$condsAn array of conditions which determines which rows are fetched
$groupingAn array of elements to group by
$custom_fieldsAn array of extra fields to fetch, each field may be a SQL operation

Referenced by checkNodeMovements(), eZContentObjectAttribute\cloneContentObjectAttribute(), eZRSSFunctionCollection\exportByNode(), eZProductCategory\fetch(), eZDiscountRule\fetch(), eZSection\fetch(), eZOperationMemento\fetch(), eZVatRule\fetch(), eZURLObjectLink\fetch(), eZUserDiscountRule\fetch(), eZWorkflowGroup\fetch(), eZCollaborationProfile\fetch(), eZUserSetting\fetch(), eZContentBrowseBookmark\fetch(), eZDiscountSubRule\fetch(), eZTipafriendCounter\fetch(), eZContentBrowseRecent\fetch(), eZViewCounter\fetch(), eZVatType\fetch(), eZCollaborationItemStatus\fetch(), eZWorkflowGroupLink\fetch(), eZEnumObjectValue\fetch(), eZProductCollection\fetch(), eZTrigger\fetch(), eZBinaryFile\fetch(), eZCollaborationItemGroupLink\fetch(), eZEnumValue\fetch(), eZCollaborationSimpleMessage\fetch(), eZOrderStatus\fetch(), eZProductCollectionItem\fetch(), eZContentClassGroup\fetch(), eZContentClassClassGroup\fetch(), eZCollaborationItemMessageLink\fetch(), eZCollaborationItemParticipantLink\fetch(), eZWorkflowEvent\fetch(), eZContentObjectAttribute\fetch(), eZWaitUntilDateValue\fetch(), eZOrderStatusHistory\fetch(), eZCollaborationItem\fetch(), eZMedia\fetch(), eZContentObjectVersion\fetch(), eZCollaborationGroup\fetch(), eZNotificationEvent\fetch(), eZURLWildcard\fetch(), eZOrder\fetch(), eZRSSExportItem\fetch(), eZRSSImport\fetch(), eZPDFExport\fetch(), eZURL\fetch(), eZRSSExport\fetch(), eZUser\fetch(), eZBasket\fetch(), eZWorkflow\fetch(), eZContentClassAttribute\fetch(), eZPolicy\fetch(), eZNodeAssignment\fetch(), eZInformationCollection\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(), eZInformationCollection\fetchByUserIdentifier(), eZOperationMemento\fetchChild(), eZNotificationCollection\fetchForHandler(), eZGeneralDigestUserSettings\fetchForUser(), 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. If $asObject is true the array contains objects otherwise a db row.

Parameters
$defA definition array of all fields, table name and sorting
$field_filtersIf defined determines the fields which are extracted (array of field names), if not all fields are fetched
$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 - Element 0 is the match operator and element 1 is the scalar value
    array( 'priority' => array( '>', 5 ) )
    generates SQL
    priority > 5
  • Array with range - Element 1 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 - Element 0 is an array with scalar values
    array( 'id' => array( array( 1, 5, 7 ) ) )
    generates SQL
    id IN ( 1, 5, 7 )
$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 string 'asc' for ascending or 'desc' for descending.
$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
$asObjectIf true then it will return an array with objects, objects are created from class defined in $def. If false it will just return the rows fetch from database.
$groupingAn array of fields to group by or null to use grouping in defintion $def.
$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.
$custom_tablesArray of additional tables.
$custom_condsString with sql conditions for 'WHERE' clause.

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 );

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.

$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 );

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(), eZURLObjectLink\fetchLinkList(), eZContentClassName\fetchList(), eZDiscountRule\fetchList(), eZProductCategory\fetchList(), eZDiscountSubRuleValue\fetchList(), eZCollaborationNotificationRule\fetchList(), eZOrderItem\fetchList(), eZVatRule\fetchList(), eZCurrencyData\fetchList(), eZWorkflowGroup\fetchList(), eZISBNGroup\fetchList(), eZDiscountSubRule\fetchList(), eZSubtreeNotificationRule\fetchList(), eZPolicyLimitationValue\fetchList(), eZTrigger\fetchList(), eZVatType\fetchList(), eZOperationMemento\fetchList(), eZISBNGroupRange\fetchList(), eZCollaborationItemGroupLink\fetchList(), eZProductCollectionItemOption\fetchList(), eZProductCollectionItem\fetchList(), eZContentClassGroup\fetchList(), eZSection\fetchList(), eZWorkflowEvent\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(), 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(), storeObject(), 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.

Referenced by eZPersistentObject().

static eZPersistentObject::getShortAttributeName (   $db,
  $def,
  $attrName 
)
static
Returns
short attribute name (alias) if it's defined, given attribute name otherwise

Referenced by eZURL\handleList().

static eZPersistentObject::handleRows (   $rows,
  $class_name,
  $asObject 
)
static
eZPersistentObject::hasAttribute (   $attr)
Returns
true if the attribute $attr is part of the definition fields or function attributes.

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

eZPersistentObject::hasDirtyData ( )
Returns
true if the data is considered dirty and needs to be stored.
See Also
sync

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.

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.

Referenced by eZPDFExport\remove(), eZContentClass\remove(), eZWorkflow\removeThis(), eZContentLanguage\removeThis(), eZProductCollectionItem\removeThis(), eZRSSExport\removeThis(), eZSection\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.

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(), eZProductCategory\removeByID(), eZEnumValue\removeByID(), eZISBNGroupRange\removeByID(), eZISBNRegistrantRange\removeByID(), eZWaitUntilDateValue\removeByID(), eZMultiPriceData\removeByID(), eZBinaryFile\removeByID(), eZMedia\removeByID(), eZUserDiscountRule\removeByID(), eZContentObjectStateGroup\removeByID(), eZContentObjectState\removeByID(), eZCollaborationNotificationRule\removeByIdentifier(), eZURLWildcard\removeByIDs(), eZSubtreeNotificationRule\removeByNodeAndUserID(), eZEnumObjectValue\removeByOAID(), eZMultiPriceData\removeByOAID(), eZDiscountSubRuleValue\removeBySubRuleID(), eZUserAccountKey\removeByUserID(), eZForgotPassword\removeByUserID(), eZUserSetting\removeByUserID(), eZCollaborationNotificationRule\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. $def is the object definition. 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.

See Also
swapRow
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
$orderFieldAssociative array with one element, the key is the order id and values is order value.

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

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

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.

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.

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.

See Also
hasDirtyData, sync

Referenced by setAttribute().

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

Stores the data in $obj to database.

Parameters
fieldFiltersIf specified only certain fields will be stored.
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.

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.

Referenced by reorderObject().

eZPersistentObject::sync (   $fieldFilters = null)

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

See Also
hasDirtyData
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.

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

static eZPersistentObject::updateObjectList (   $parameters)
static
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.

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

Member Data Documentation

eZPersistentObject::$PersistentDataDirty

Whether the data is dirty, ie needs to be stored, or not.

Referenced by hasDirtyData().


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