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


PHP EntryManager::edit方法代码示例

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


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

示例1: commit

 /**
  * Commits this Entry's data to the database, by first finding the default
  * data for this `Entry` and then utilising the `EntryManager`'s
  * add or edit function. The `EntryManager::edit` function is used if
  * the current `Entry` object has an ID, otherwise `EntryManager::add`
  * is used.
  *
  * @see toolkit.Entry#findDefaultData()
  * @return boolean
  *  true if the commit was successful, false otherwise.
  */
 public function commit()
 {
     $this->findDefaultData();
     return $this->get('id') ? EntryManager::edit($this) : EntryManager::add($this);
 }
开发者ID:bauhouse,项目名称:Piano-Sonata,代码行数:16,代码来源:class.entry.php

示例2: foreach

            $newPublishTimestamp = $date->get(true, false);
        }
        if (isset($_FILES) && is_array($_FILES['fields']) && !empty($_FILES['fields'])) {
            foreach ($_FILES['fields'] as $type => $f) {
                $custom = $f['custom'];
                foreach ($f['custom'] as $name => $list) {
                    foreach ($list as $id => $info) {
                        $data['custom'][$name]['files'][$id][$type] = $info;
                    }
                }
            }
        }
        $change_handle = $Admin->getConfigVar("allow_primary_field_handles_to_change", "symphony");
        $change_handle = intval($change_handle);
        $change_handle = $change_handle == 1 ? true : false;
        $retval = $entryManager->edit($entry_id, $data['custom'], $newPublishTimestamp, 'real', $change_handle);
        if (!$retval) {
            define("__SYM_DB_INSERT_FAILED__", true);
        } else {
            $Admin->flush_cache(array("entries", "authors"));
            ###
            # Delegate: Edit
            # Description: Editing an entry. Section and Entry ID are provided.
            $CampfireManager->notifyMembers('Edit', CURRENTPAGE, array('section_id' => $section_id, 'entry_id' => $entry_id));
            if (@array_key_exists("save", $_POST['action'])) {
                General::redirect($Admin->getCurrentPageURL() . "&_sid={$section_id}&id={$entry_id}&_f=saved");
            }
            General::redirect(URL . "/symphony/?page=/publish/section/&_sid={$section_id}");
        }
    }
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_section_edit.php

示例3: commit

 function commit()
 {
     $this->findDefaultData();
     $EntryManager = new EntryManager($this->_engine);
     return $this->get('id') ? $EntryManager->edit($this) : $EntryManager->add($this);
 }
开发者ID:bauhouse,项目名称:sym-form-builder,代码行数:6,代码来源:class.entry.php

示例4: commit

 public function commit()
 {
     $options = $this->options();
     $existing = array();
     $section = SectionManager::fetch($options['section']);
     if ((int) $options['unique-field'] > 0) {
         $field = FieldManager::fetch($options['unique-field']);
         if (!empty($field)) {
             foreach ($this->_entries as $index => $current) {
                 $entry = $current['entry'];
                 $data = $entry->getData($options['unique-field']);
                 $where = $joins = $group = null;
                 $field->buildDSRetrievalSQL($data, $joins, $where);
                 $group = $field->requiresSQLGrouping();
                 $entries = EntryManager::fetch(null, $options['section'], 1, null, $where, $joins, $group, false, null, false);
                 if (is_array($entries) && !empty($entries)) {
                     $existing[$index] = $entries[0]['id'];
                 } else {
                     $existing[$index] = null;
                 }
             }
         }
     }
     foreach ($this->_entries as $index => $current) {
         $entry = $current['entry'];
         $values = $current['values'];
         $date = DateTimeObj::get('Y-m-d H:i:s');
         $dateGMT = DateTimeObj::getGMT('Y-m-d H:i:s');
         $exists = !empty($existing[$index]);
         $skip = $options['can-update'] !== 'yes';
         // Skip entry
         if ($exists && $skip) {
             $entry->set('importer_status', 'skipped');
             ###
             # Delegate: XMLImporterEntryPostSkip
             # Description: Skipping an entry. Entry object is provided.
             Symphony::ExtensionManager()->notifyMembers('XMLImporterEntryPostSkip', '/xmlimporter/importers/run/', array('section' => $section, 'entry' => $entry, 'fields' => $values));
         } elseif ($exists) {
             $entry->set('id', $existing[$index]);
             $entry->set('modification_date', $date);
             $entry->set('modification_date_gmt', $dateGMT);
             ###
             # Delegate: XMLImporterEntryPreEdit
             # Description: Just prior to editing of an Entry.
             Symphony::ExtensionManager()->notifyMembers('XMLImporterEntryPreEdit', '/xmlimporter/importers/run/', array('section' => $section, 'fields' => &$values, 'entry' => &$entry));
             EntryManager::edit($entry);
             $entry->set('importer_status', 'updated');
             ###
             # Delegate: XMLImporterEntryPostEdit
             # Description: Editing an entry. Entry object is provided.
             Symphony::ExtensionManager()->notifyMembers('XMLImporterEntryPostEdit', '/xmlimporter/importers/run/', array('section' => $section, 'entry' => $entry, 'fields' => $values));
         } else {
             $entry->set('creation_date', $date);
             $entry->set('creation_date_gmt', $dateGMT);
             $entry->set('modification_date', $date);
             $entry->set('modification_date_gmt', $dateGMT);
             ###
             # Delegate: XMLImporterEntryPreCreate
             # Description: Just prior to creation of an Entry. Entry object provided
             Symphony::ExtensionManager()->notifyMembers('XMLImporterEntryPreCreate', '/xmlimporter/importers/run/', array('section' => $section, 'fields' => &$values, 'entry' => &$entry));
             EntryManager::add($entry);
             $entry->set('importer_status', 'created');
             ###
             # Delegate: XMLImporterEntryPostCreate
             # Description: Creation of an Entry. New Entry object is provided.
             Symphony::ExtensionManager()->notifyMembers('XMLImporterEntryPostCreate', '/xmlimporter/importers/run/', array('section' => $section, 'entry' => $entry, 'fields' => $values));
         }
     }
 }
开发者ID:symphonists,项目名称:xmlimporter,代码行数:69,代码来源:class.xmlimporter.php


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