コード例 #1
0
 function store($fieldFilters = null)
 {
     parent::store($fieldFilters);
     if ($this->OriginalID == 0) {
         $this->OriginalID = $this->ID;
         parent::store($fieldFilters);
     }
 }
コード例 #2
0
 function store($fieldFilters = null)
 {
     $dateTime = time();
     $user = eZUser::currentUser();
     $this->setAttribute('modifier_id', $user->attribute('contentobject_id'));
     $this->setAttribute('modified', $dateTime);
     parent::store($fieldFilters);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: ezpdfexport.php プロジェクト: CG77/ezpublish-legacy
 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();
 }
コード例 #6
0
ファイル: ezrssexport.php プロジェクト: nfrp/ezpublish
 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);
     }
 }
コード例 #7
0
 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();
 }
コード例 #8
0
ファイル: ezurlwildcard.php プロジェクト: nottavi/ezpublish
 /**
  * Stores the eZURLWildcard persistent object
  */
 public function store( $fieldFilters = null )
 {
     eZPersistentObject::store( $fieldFilters );
 }
コード例 #9
0
 function storeNewRow()
 {
     return eZPersistentObject::store();
 }
コード例 #10
0
 function storeNewRow()
 {
     return parent::store();
 }
コード例 #11
0
 /**
  * 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);
 }
コード例 #12
0
 function store($fieldFilters = null)
 {
     $db = eZDB::instance();
     $db->begin();
     parent::store($fieldFilters);
     $this->updateAndStoreModified();
     $db->commit();
 }
コード例 #13
0
 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);
 }
コード例 #14
0
 function store($fieldFilters = null)
 {
     eZPersistentObject::store($fieldFilters);
     $this->updateCache();
     return true;
 }
コード例 #15
0
 /**
  * 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);
 }
コード例 #16
0
 /**
  * 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();
 }
コード例 #17
0
 function store($fieldFilters = null)
 {
     parent::store($fieldFilters);
     $this->updateCache();
     return true;
 }
コード例 #18
0
    /**
     * 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();
    }
コード例 #19
0
ファイル: ezcurrencydata.php プロジェクト: nfrp/ezpublish
 function store($fieldFilters = null)
 {
     // data changed => reset RateValue
     $this->invalidateRateValue();
     parent::store($fieldFilters);
 }
コード例 #20
0
ファイル: ezcontentobjectversion.php プロジェクト: ataxel/tp
 public function store( $fieldFilters = null )
 {
     eZContentObject::clearCache( $this->attribute( 'contentobject_id' ) );
     parent::store( $fieldFilters );
 }
コード例 #21
0
 /**
  * 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);
 }
コード例 #22
0
 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;
 }
コード例 #23
0
 /**
  * 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);
 }
コード例 #24
0
 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();
 }
コード例 #25
0
    /**
     * 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();
    }
コード例 #26
0
 /**
  * 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);
     }
 }
コード例 #27
0
 function store($fieldFilters = null)
 {
     // data changed => reset RateValue
     $this->invalidateRateValue();
     eZPersistentObject::store($fieldFilters);
 }
コード例 #28
0
 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);
 }
コード例 #29
0
 function storeDefined($fieldFilters = null)
 {
     $db = eZDB::instance();
     $db->begin();
     $stored = eZPersistentObject::store($fieldFilters);
     $eventType = $this->eventType();
     $eventType->storeDefinedEventData($this);
     $db->commit();
     return $stored;
 }