当前位置: 首页>>代码示例>>PHP>>正文


PHP eZPersistentObject::storeObject方法代码示例

本文整理汇总了PHP中eZPersistentObject::storeObject方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPersistentObject::storeObject方法的具体用法?PHP eZPersistentObject::storeObject怎么用?PHP eZPersistentObject::storeObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZPersistentObject的用法示例。


在下文中一共展示了eZPersistentObject::storeObject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * 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);
     }
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:70,代码来源:ezcontentobjectstate.php

示例2: store

 /**
  * Stores the content object state group and its translations.
  *
  * Before storing a content object state group, you should use
  * {@link eZContentObjectStateGroup::isValid()} to check its validness.
  *
  * @param array $fieldFilters
  */
 public function store($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('real_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 {
                 $translation->setAttribute('language_id', $languageID & ~1);
             }
             $languageMask = $languageMask | $languageID;
         }
     }
     $this->setAttribute('language_mask', $languageMask);
     // store state group
     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_group_id') !== null) {
                 $translation->remove();
             }
         } else {
             if ($translation->attribute('contentobject_state_group_id') != $this->ID) {
                 $translation->setAttribute('contentobject_state_group_id', $this->ID);
             }
             $translation->store();
         }
     }
     $handler = eZExpiryHandler::instance();
     $handler->setTimestamp('state-limitations', time());
     $db->commit();
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:51,代码来源:ezcontentobjectstategroup.php

示例3: store

 /**
  * reimplementation
  * update edtionObject modified date, so you can sort_by in admin interface
  *
  * @param unknown_type $fieldFilters
  * @return void
  */
 function store($fieldFilters = null)
 {
     $this->setEditionObjectModified();
     parent::storeObject($this, $fieldFilters);
 }
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:12,代码来源:cjwnewslettereditionsend.php

示例4: storeObjectAttribute

 function storeObjectAttribute($attribute)
 {
     if ($attribute->ID === null) {
         eZPersistentObject::storeObject($attribute);
     }
     $meta = $attribute->content();
     $xmlString = self::saveXML($meta);
     $attribute->setAttribute('data_text', $xmlString);
     // save keywords
     $keyword = new eZKeyword();
     $keyword->setKeywordArray($meta->keywords);
     $keyword->store($attribute);
 }
开发者ID:rantoniazzi,项目名称:xrowmetadata,代码行数:13,代码来源:xrowmetadatatype.php

示例5: store

 /**
  * Stores the object in the database, uses storeObject() to do the actual
  * job and passes $fieldFilters to it.
  *
  * 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 array|null $fieldFilters
  * @return void
  */
 public function store($fieldFilters = null)
 {
     eZPersistentObject::storeObject($this, $fieldFilters);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:15,代码来源:ezpersistentobject.php

示例6: store

 public function store($fieldFilters = null)
 {
     $this->setAttribute('backtrace', serialize($this->attribute('backtrace')));
     eZPersistentObject::storeObject($this, $fieldFilters);
     $this->setAttribute('backtrace', unserialize($this->attribute('backtrace')));
 }
开发者ID:nxc,项目名称:responsys,代码行数:6,代码来源:log_item.php

示例7: store

 function store($fieldFilters = null)
 {
     /* New object ? */
     if (!isset($this->UUID)) {
         $this->UUID = self::UUID();
     }
     eZPersistentObject::storeObject($this, $fieldFilters);
 }
开发者ID:jjohnsen,项目名称:jaj_newsletter,代码行数:8,代码来源:jajnewslettersubscription.php

示例8: storeObjectAttribute

 function storeObjectAttribute($attribute)
 {
     if ($attribute->ID === null) {
         eZPersistentObject::storeObject($attribute);
     }
     $meta = $attribute->content();
     $xml = new DOMDocument("1.0", "UTF-8");
     $xmldom = $xml->createElement("MetaData");
     $node = $xml->createElement("title", htmlspecialchars($meta->title, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $node = $xml->createElement("keywords", htmlspecialchars($meta->keywords, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $node = $xml->createElement("description", htmlspecialchars($meta->description, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $node = $xml->createElement("priority", htmlspecialchars($meta->priority, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $node = $xml->createElement("change", htmlspecialchars($meta->change, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $node = $xml->createElement("googlemap", htmlspecialchars($meta->googlemap, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $xml->appendChild($xmldom);
     $node = $xml->createElement("urlsegment", htmlspecialchars($meta->urlsegment, ENT_QUOTES, 'UTF-8'));
     $xmldom->appendChild($node);
     $xml->appendChild($xmldom);
     $attribute->setAttribute('data_text', $xml->saveXML());
     // save keywords
     $keyword = new eZKeyword();
     $keyword->initializeKeyword($meta->keywords);
     $keyword->store($attribute);
 }
开发者ID:heliopsis,项目名称:xrowmetadata,代码行数:30,代码来源:xrowmetadatatype.php


注:本文中的eZPersistentObject::storeObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。