當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JHelperTags::preStoreProcess方法代碼示例

本文整理匯總了PHP中JHelperTags::preStoreProcess方法的典型用法代碼示例。如果您正苦於以下問題:PHP JHelperTags::preStoreProcess方法的具體用法?PHP JHelperTags::preStoreProcess怎麽用?PHP JHelperTags::preStoreProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JHelperTags的用法示例。


在下文中一共展示了JHelperTags::preStoreProcess方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onBeforeStore

 /**
  * Pre-processor for $table->store($updateNulls)
  *
  * @param   boolean  $updateNulls  The result of the load
  * @param   string   $tableKey     The key of the table
  *
  * @return  void
  *
  * @since   3.1.2
  */
 public function onBeforeStore($updateNulls, $tableKey)
 {
     $this->parseTypeAlias();
     if (empty($this->table->tagsHelper->tags)) {
         $this->tagsHelper->preStoreProcess($this->table);
     } else {
         $this->tagsHelper->preStoreProcess($this->table, (array) $this->table->tagsHelper->tags);
     }
 }
開發者ID:edwardmagbago,項目名稱:joomlatools-platform-content,代碼行數:19,代碼來源:tags.php

示例2: store

 /**
  * Overrides JTable::store to set modified data and user id.
  *
  * @param   boolean  $updateNulls  True to update fields even if they are null.
  *
  * @return  boolean  True on success.
  *
  * @since   11.1
  */
 public function store($updateNulls = false)
 {
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing item
         $this->modified = $date->toSql();
         $this->modified_by = $user->get('id');
     } else {
         // New article. An article created and created_by field can be set by the user,
         // so we don't touch either of these if they are set.
         if (!(int) $this->created) {
             $this->created = $date->toSql();
         }
         if (empty($this->created_by)) {
             $this->created_by = $user->get('id');
         }
     }
     // Verify that the alias is unique
     $table = JTable::getInstance('Content', 'JTable');
     if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS'));
         return false;
     }
     $this->tagsHelper->typeAlias = 'com_content.article';
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:38,代碼來源:content.php

示例3: store

 /**
  * Overriden JTable::store to set modified data.
  *
  * @param   boolean	True to update fields even if they are null.
  * @return  boolean  True on success.
  * @since   1.6
  */
 public function store($updateNulls = false)
 {
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing item
         $this->modified = $date->toSql();
         $this->modified_by = $user->get('id');
     } else {
         // New newsfeed. A feed created and created_by field can be set by the user,
         // so we don't touch either of these if they are set.
         if (!(int) $this->created) {
             $this->created = $date->toSql();
         }
         if (empty($this->created_by)) {
             $this->created_by = $user->get('id');
         }
     }
     /*
     // Verify that the alias is unique
     $table = JTable::getInstance('Product', 'WcatalogTable');
     if ($table->load(array('category_id' => $this->category_id)) && ($table->id != $this->id || $this->id == 0))
     {
     	$this->setError(JText::_('COM_WCATALOG_ERROR_UNIQUE_ALIAS'));
     	return false;
     }
     */
     $this->tagsHelper->typeAlias = 'com_wcatalog.product';
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:whiteof,項目名稱:comcar,代碼行數:39,代碼來源:product.php

示例4: store

 /**
  * Overriden JTable::store to set modified data.
  *
  * @param   boolean	True to update fields even if they are null.
  * @return  boolean  True on success.
  * @since   1.6
  */
 public function store($updateNulls = false)
 {
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing item
         $this->modified = $date->toSql();
         $this->modified_by = $user->get('id');
     } else {
         // New newsfeed. A feed created and created_by field can be set by the user,
         // so we don't touch either of these if they are set.
         if (!(int) $this->created) {
             $this->created = $date->toSql();
         }
         if (empty($this->created_by)) {
             $this->created_by = $user->get('id');
         }
     }
     // Verify that the alias is unique
     $table = JTable::getInstance('Category', 'WcatalogTable');
     $this->tagsHelper->typeAlias = 'com_wcatalog.category';
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:whiteof,項目名稱:comcar,代碼行數:32,代碼來源:category.php

示例5: onBeforeSave

 /**
  * The event which runs before storing (saving) data to the database
  *
  * @param   DataModel  &$model  The model which calls this event
  * @param   null|array $data    [Optional] Data to bind
  *
  * @return  boolean  True to allow saving
  */
 public function onBeforeSave(&$model, &$data)
 {
     if ($model->hasTags()) {
         $tagsHelper = new \JHelperTags();
         $tagsHelper->typeAlias = $model->getContentType();
         // JHelperTags in Joomla! 3.1, it required tags in the metadata property.
         // TODO If this issue is fixed in Joomla! we need to remove this code
         $tagsTable = clone $model;
         $tagsHelper->preStoreProcess($tagsTable);
     }
 }
開發者ID:Joal01,項目名稱:fof,代碼行數:19,代碼來源:Tags.php

示例6: onBeforeStore

 /**
  * The event which runs before storing (saving) data to the database
  *
  * @param   FOFTable  &$table  The table which calls this event
  * @param   boolean  $updateNulls  Should nulls be saved as nulls (true) or just skipped over (false)?
  *
  * @return  boolean  True to allow saving
  */
 public function onBeforeStore(&$table, $updateNulls)
 {
     if ($table->hasTags()) {
         $tagsHelper = new JHelperTags();
         $tagsHelper->typeAlias = $table->getContentType();
         // TODO: JHelperTags sucks in Joomla! 3.1, it requires that tags are
         // stored in the metadata property. Not our case, therefore we need
         // to add it in a fake object. We sent a PR to Joomla! CMS to fix
         // that. Once it's accepted, we'll have to remove the attrocity
         // here...
         $tagsTable = clone $table;
         $tagsHelper->preStoreProcess($tagsTable);
     }
 }
開發者ID:deenison,項目名稱:joomla-cms,代碼行數:22,代碼來源:tags.php

示例7: store

 /**
  * Stores a contact
  *
  * @param   boolean	True to update fields even if they are null.
  *
  * @return  boolean  True on success, false on failure.
  *
  * @since   1.6
  */
 public function store($updateNulls = false)
 {
     // Transform the params field
     if (is_array($this->params)) {
         $registry = new JRegistry();
         $registry->loadArray($this->params);
         $this->params = (string) $registry;
     }
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing item
         $this->modified = $date->toSql();
         $this->modified_by = $user->get('id');
     } else {
         // New contact. A contact created and created_by field can be set by the user,
         // so we don't touch either of these if they are set.
         if (!(int) $this->created) {
             $this->created = $date->toSql();
         }
         if (empty($this->created_by)) {
             $this->created_by = $user->get('id');
         }
     }
     // Set publish_up to null date if not set
     if (!$this->publish_up) {
         $this->publish_up = $this->_db->getNullDate();
     }
     // Set publish_down to null date if not set
     if (!$this->publish_down) {
         $this->publish_down = $this->_db->getNullDate();
     }
     // Set xreference to empty string if not set
     if (!$this->xreference) {
         $this->xreference = '';
     }
     // Verify that the alias is unique
     $table = JTable::getInstance('Contact', 'ContactTable');
     if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
         $this->setError(JText::_('COM_CONTACT_ERROR_UNIQUE_ALIAS'));
         return false;
     }
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:55,代碼來源:contact.php

示例8: store

 /**
  * Overridden JTable::store to set created/modified and user id.
  *
  * @param   boolean  $updateNulls  True to update fields even if they are null.
  *
  * @return  boolean  True on success.
  *
  * @since   11.1
  */
 public function store($updateNulls = false)
 {
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing category
         $this->modified_time = $date->toSql();
         $this->modified_user_id = $user->get('id');
     } else {
         // New category
         $this->created_time = $date->toSql();
         $this->created_user_id = $user->get('id');
     }
     // Verify that the alias is unique
     $table = JTable::getInstance('Category', 'JTable', array('dbo' => $this->getDbo()));
     if ($table->load(array('alias' => $this->alias, 'parent_id' => $this->parent_id, 'extension' => $this->extension)) && ($table->id != $this->id || $this->id == 0)) {
         $this->setError(JText::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS'));
         return false;
     }
     $this->tagsHelper->typeAlias = $this->extension . '.category';
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:33,代碼來源:category.php

示例9: store

 /**
  * Overload the store method for the Weblinks table.
  *
  * @param   boolean	Toggle whether null values should be updated.
  * @return  boolean  True on success, false on failure.
  * @since   1.6
  */
 public function store($updateNulls = false)
 {
     $date = JFactory::getDate();
     $user = JFactory::getUser();
     if ($this->id) {
         // Existing item
         $this->modified = $date->toSql();
         $this->modified_by = $user->get('id');
     } else {
         // New weblink. A weblink created and created_by field can be set by the user,
         // so we don't touch either of these if they are set.
         if (!(int) $this->created) {
             $this->created = $date->toSql();
         }
         if (empty($this->created_by)) {
             $this->created_by = $user->get('id');
         }
     }
     // Set publish_up to null date if not set
     if (!$this->publish_up) {
         $this->publish_up = $this->_db->getNullDate();
     }
     // Set publish_down to null date if not set
     if (!$this->publish_down) {
         $this->publish_down = $this->_db->getNullDate();
     }
     // Verify that the alias is unique
     $table = JTable::getInstance('Weblink', 'WeblinksTable');
     if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
         $this->setError(JText::_('COM_WEBLINKS_ERROR_UNIQUE_ALIAS'));
         return false;
     }
     $this->tagsHelper->preStoreProcess($this);
     $result = parent::store($updateNulls);
     return $result && $this->tagsHelper->postStoreProcess($this);
 }
開發者ID:GitIPFire,項目名稱:Homeworks,代碼行數:43,代碼來源:weblink.php

示例10: onBeforeStore

 /**
  * Pre-processor for $table->store($updateNulls)
  *
  * @param   boolean  $updateNulls  The result of the load
  * @param   string   $tableKey     The key of the table
  *
  * @return  void
  */
 public function onBeforeStore($updateNulls, $tableKey)
 {
     $this->parseTypeAlias();
     $this->tagsHelper->preStoreProcess($this->table);
 }
開發者ID:fur81,項目名稱:zofaxiopeu,代碼行數:13,代碼來源:tags.php

示例11: saveUCM

 function saveUCM($type, $element, $tags = array())
 {
     if (!isset($this->structure[$type]) || !$this->_isCompatible) {
         return false;
     }
     $structure = $this->structure[$type];
     $component = 'hikashop';
     if (!empty($structure['component'])) {
         $component = $structure['component'];
     }
     $alias = 'com_' . $component . '.' . $structure['table'];
     $tagsHelper = new JHelperTags();
     $tagsHelper->typeAlias = $alias;
     $tagsTable = new JHikaShopTagTable($structure, $element);
     $tagsHelper->preStoreProcess($tagsTable);
     $ret = $tagsHelper->postStoreProcess($tagsTable, $tags);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:17,代碼來源:tags.php


注:本文中的JHelperTags::preStoreProcess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。