function store($fieldFilters = null) { parent::store($fieldFilters); if ($this->OriginalID == 0) { $this->OriginalID = $this->ID; parent::store($fieldFilters); } }
function store($fieldFilters = null) { $dateTime = time(); $user = eZUser::currentUser(); $this->setAttribute('modifier_id', $user->attribute('contentobject_id')); $this->setAttribute('modified', $dateTime); parent::store($fieldFilters); }
function store($fieldFilters = null) { if ($this->ContentobjectID == eZUser::anonymousId()) { eZUser::purgeUserCacheByAnonymousId(); } else { $handler = eZExpiryHandler::instance(); $handler->setTimestamp('user-discountrules-cache', time()); $handler->store(); } parent::store($fieldFilters); }
function store($fieldFilters = null) { if ($this->QuestionOriginalID == 0) { $db = eZDB::instance(); $id = $this->QuestionID; $question = eZSurveyQuestion::fetch($id); if (get_class($question) == 'eZSurveyQuestion') { $this->QuestionOriginalID = $question->attribute('original_id'); } } parent::store($fieldFilters); }
function store($publish = false) { if ($publish) { $originalVersion = $this->attribute('version'); $this->setAttribute('version', eZPDFExport::VERSION_VALID); } $user = eZUser::currentUser(); $this->setAttribute('modified', time()); $this->setAttribute('modifier_id', $user->attribute('contentobject_id')); $db = eZDB::instance(); $db->begin(); parent::store(); if ($publish) { $this->setAttribute('version', eZPDFExport::VERSION_DRAFT); $this->remove(); $this->setAttribute('version', $originalVersion); } $db->commit(); }
function store($storeAsValid = false) { $dateTime = time(); $user = eZUser::currentUser(); if ($this->ID == null) { parent::store(); return; } $db = eZDB::instance(); $db->begin(); if ($storeAsValid) { $oldStatus = $this->attribute('status'); $this->setAttribute('status', eZRSSExport::STATUS_VALID); } $this->setAttribute('modified', $dateTime); $this->setAttribute('modifier_id', $user->attribute("contentobject_id")); parent::store(); $db->commit(); if ($storeAsValid) { $this->setAttribute('status', $oldStatus); } }
function store($fieldFilters = null) { $db = eZDB::instance(); $db->begin(); // Store the rule itself. parent::store($fieldFilters); // Store product categories associated with the rule, $this->removeProductCategories(); $categories = $this->attribute('product_categories'); if ($categories) { foreach ($categories as $category) { $query = sprintf("INSERT INTO ezvatrule_product_category " . "(vatrule_id, product_category_id) VALUES (%d,%d)", $this->ID, $category['id']); $db->query($query); } } $db->commit(); }
/** * Stores the eZURLWildcard persistent object */ public function store( $fieldFilters = null ) { eZPersistentObject::store( $fieldFilters ); }
function storeNewRow() { return eZPersistentObject::store(); }
function storeNewRow() { return parent::store(); }
/** * if nl user exists update this data to * (non-PHPdoc) * @see kernel/classes/eZPersistentObject#store($fieldFilters) */ public function store($fieldFilters = null) { $newsletterUserObject = $this->getNewsletterUserObject(); if (is_object($newsletterUserObject)) { $newsletterUserObject->setBlacklisted(); } parent::store($fieldFilters); }
function store($fieldFilters = null) { $db = eZDB::instance(); $db->begin(); parent::store($fieldFilters); $this->updateAndStoreModified(); $db->commit(); }
function store($fieldFilters = null) { $this->Email = trim($this->Email); $userID = $this->attribute('contentobject_id'); // Clear memory cache unset($GLOBALS['eZUserObject_' . $userID]); $GLOBALS['eZUserObject_' . $userID] = $this; self::purgeUserCacheByUserId($userID); parent::store($fieldFilters); }
function store($fieldFilters = null) { eZPersistentObject::store($fieldFilters); $this->updateCache(); return true; }
/** * set Modifed data if somebody store content * (non-PHPdoc) * @see kernel/classes/eZPersistentObject#store($fieldFilters) */ public function store($fieldFilters = null) { $this->setModified(); parent::store($fieldFilters); }
/** * Stores the current class as a modified version, updates the contentobject_name * attribute and recreates the class group entries. * * @note It will remove classes in the previous and specified version before storing. * * @param array $attributes array of attributes * @param int $version version status * @since Version 4.3 */ public function storeVersioned($attributes, $version) { $previousVersion = $this->attribute('version'); $db = eZDB::instance(); $db->begin(); // Before removing anything from the attributes, load attribute information // which might otherwise not accessible when recreating them below. // See issue #18164 foreach ($attributes as $attribute) { $attribute->content(); } $this->removeAttributes(false, $version); $this->removeAttributes(false, $previousVersion); $this->remove(false); $this->setVersion($version, $attributes); $this->setAttribute("modifier_id", eZUser::currentUser()->attribute("contentobject_id")); $this->setAttribute("modified", time()); $this->adjustAttributePlacements($attributes); foreach ($attributes as $attribute) { $attribute->storeVersioned($version); } // Set contentobject_name to something sensible if it is missing if (count($attributes) > 0 && trim($this->attribute('contentobject_name')) == '') { $this->setAttribute('contentobject_name', '<' . $attributes[0]->attribute('identifier') . '>'); } // Recreate class member entries eZContentClassClassGroup::removeClassMembers($this->ID, $version); foreach (eZContentClassClassGroup::fetchGroupList($this->ID, $previousVersion) as $classgroup) { $classgroup->setAttribute('contentclass_version', $version); $classgroup->store(); } eZContentClassClassGroup::removeClassMembers($this->ID, $previousVersion); eZExpiryHandler::registerShutdownFunction(); $handler = eZExpiryHandler::instance(); $time = time(); $handler->setTimestamp('user-class-cache', $time); $handler->setTimestamp('class-identifier-cache', $time); $handler->setTimestamp('sort-key-cache', $time); $handler->store(); eZContentCacheManager::clearAllContentCache(); $this->setAttribute('serialized_name_list', $this->NameList->serializeNames()); $this->setAttribute('serialized_description_list', $this->DescriptionList->serializeNames()); eZPersistentObject::store(); $this->NameList->store($this); $db->commit(); }
function store($fieldFilters = null) { parent::store($fieldFilters); $this->updateCache(); return true; }
/** * Store the content class in the specified version status. * * @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. * * @param int $version version status * @since Version 4.3 * @return null|false false if the operation failed */ function storeVersioned( $version ) { $dataType = $this->dataType(); if ( !$dataType ) { return false; } self::expireCache( $this->ID, $this->attribute( 'contentclass_id' ) ); $db = eZDB::instance(); $db->begin(); $dataType->preStoreVersionedClassAttribute( $this, $version ); $this->setAttribute( 'serialized_name_list', $this->NameList->serializeNames() ); $this->setAttribute( 'serialized_description_list', $this->DescriptionList->serializeNames() ); $this->setAttribute( 'serialized_data_text', $this->DataTextI18nList->serializeNames() ); eZPersistentObject::store(); // store the content data for this attribute $dataType->storeVersionedClassAttribute( $this, $version ); $db->commit(); }
function store($fieldFilters = null) { // data changed => reset RateValue $this->invalidateRateValue(); parent::store($fieldFilters); }
public function store( $fieldFilters = null ) { eZContentObject::clearCache( $this->attribute( 'contentobject_id' ) ); parent::store( $fieldFilters ); }
/** * set Modifed data if somebody store content * (non-PHPdoc) * @see kernel/classes/eZPersistentObject#store($fieldFilters) */ public function store($fieldFilters = null) { $this->setModified(); // find and set ez_user_id $this->findAndSetRelatedEzUserId(); parent::store($fieldFilters); }
function storeDefined($fieldFilters = null) { $db = eZDB::instance(); $db->begin(); $stored = eZPersistentObject::store($fieldFilters); $eventType = $this->eventType(); if ($eventType instanceof eZWorkflowEventType) { $eventType->storeDefinedEventData($this); } else { eZDebug::writeError("Couldn't load eventype '{$this->attribute('workflow_type_string')}' for workflow. Is it activated ?", __METHOD__); } $db->commit(); return $stored; }
/** * Override store function to add some custom logic for setting create time and * store contentobject_attribute_id in session to avoid several ratings from same user. * * @param array $fieldFilters */ function store($fieldFilters = null) { if ($this->attribute('user_id') == eZUser::currentUserID()) { // Store attribute id in session to avoid multiple ratings by same user even if he logs out (gets new session key) $http = eZHTTPTool::instance(); $attributeIdList = $this->attribute('contentobject_attribute_id'); if ($http->hasSessionVariable('ezsrRatedAttributeIdList')) { $attributeIdList = $http->sessionVariable('ezsrRatedAttributeIdList') . ',' . $attributeIdList; } $http->setSessionVariable('ezsrRatedAttributeIdList', $attributeIdList); } eZPersistentObject::store($fieldFilters); }
function storeDefined($store_childs = false) { $db = eZDB::instance(); $db->begin(); if (is_array($store_childs) or $store_childs) { if (is_array($store_childs)) { $events = $store_childs; } else { $events = $this->fetchEvents(); } foreach ($events as $event) { $event->storeDefined(); } } eZPersistentObject::store(); $db->commit(); }
/** * Stores the object * * 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. * * @param array $fieldFilters */ function store( $fieldFilters = null ) { // Unset the cache global $eZContentObjectContentObjectCache; unset( $eZContentObjectContentObjectCache[$this->ID] ); global $eZContentObjectDataMapCache; unset( $eZContentObjectDataMapCache[$this->ID] ); global $eZContentObjectVersionCache; unset( $eZContentObjectVersionCache[$this->ID] ); $db = eZDB::instance(); $db->begin(); $this->storeNodeModified(); parent::store( $fieldFilters ); $db->commit(); }
/** * Stores the content object state and its translations. * * Before storing a content object state, you should use * {@link eZContentObjectState::isValid()} to check its validness. * * @param array $fieldFilters */ public function store($fieldFilters = null) { if ($fieldFilters === null) { $db = eZDB::instance(); $db->begin(); $languageMask = 1; // set language mask and always available bits foreach ($this->AllTranslations() as $translation) { if ($translation->hasData()) { $languageID = $translation->attribute('language_id'); if (empty($this->DefaultLanguageID)) { $this->DefaultLanguageID = $languageID & ~1; } // if default language, set always available flag if ($languageID & $this->DefaultLanguageID) { $translation->setAttribute('language_id', $languageID | 1); } else { if ($languageID & 1) { $translation->setAttribute('language_id', $languageID & ~1); } } $languageMask = $languageMask | $languageID; } } $assignToObjects = false; if (!isset($this->ID)) { $rows = $db->arrayQuery("SELECT MAX(priority) AS max_priority FROM ezcobj_state WHERE group_id=" . $this->GroupID); if (count($rows) > 0 && $rows[0]['max_priority'] !== null) { $this->setAttribute('priority', $rows[0]['max_priority'] + 1); } else { // this is the first state created in the state group // make all content objects use this state $assignToObjects = true; } } $this->setAttribute('language_mask', $languageMask); // store state eZPersistentObject::storeObject($this, $fieldFilters); // store or remove translations foreach ($this->AllTranslations as $translation) { if (!$translation->hasData()) { // the name and description are empty // so the translation needs to be removed if it was stored before if ($translation->attribute('contentobject_state_id') !== null) { $translation->remove(); } } else { if ($translation->attribute('contentobject_state_id') != $this->ID) { $translation->setAttribute('contentobject_state_id', $this->ID); } $translation->store(); } } if ($assignToObjects) { $stateID = $this->ID; $db->query("INSERT INTO ezcobj_state_link (contentobject_id, contentobject_state_id) SELECT id, {$stateID} FROM ezcontentobject"); } $db->commit(); } else { parent::store($fieldFilters); } }
function store($fieldFilters = null) { // data changed => reset RateValue $this->invalidateRateValue(); eZPersistentObject::store($fieldFilters); }
function store($fieldFilters = null) { if ($this->ID === null) { $this->ID = self::getNewID(); } if ($this->Link === null) { $this->Link = $this->ID; } if ($this->TextMD5 === null) { $this->TextMD5 = md5(eZURLAliasML::strtolower($this->Text)); } $this->IsOriginal = $this->ID == $this->Link ? 1 : 0; if ($this->IsAlias) { $this->IsOriginal = true; } if ($this->Action == "nop:") { // nop entries can always be replaced $this->IsOriginal = false; } if (strlen($this->ActionType) == 0) { if (preg_match("#^(.+):#", $this->Action, $matches)) { $this->ActionType = $matches[1]; } else { $this->ActionType = 'nop'; } } parent::store($fieldFilters); }
function storeDefined($fieldFilters = null) { $db = eZDB::instance(); $db->begin(); $stored = eZPersistentObject::store($fieldFilters); $eventType = $this->eventType(); $eventType->storeDefinedEventData($this); $db->commit(); return $stored; }