本文整理汇总了PHP中JUDirectoryHelper::getFieldGroupIdByListingId方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDirectoryHelper::getFieldGroupIdByListingId方法的具体用法?PHP JUDirectoryHelper::getFieldGroupIdByListingId怎么用?PHP JUDirectoryHelper::getFieldGroupIdByListingId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDirectoryHelper
的用法示例。
在下文中一共展示了JUDirectoryHelper::getFieldGroupIdByListingId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyListings
//.........这里部分代码省略.........
$table->total_votes = 0;
}
if (!in_array('copy_hits', $copy_option_arr) && $tmp_listing == false) {
$table->hits = 0;
}
if (in_array('copy_permission', $copy_option_arr)) {
$assetTable->reset();
if ($assetTable->loadByName('com_judirectory.listing.' . $listing_id)) {
$table->setRules($assetTable->rules);
} else {
$table->setRules('{}');
}
} else {
$table->setRules('{}');
}
if (!$table->check()) {
continue;
}
$result = $dispatcher->trigger('onContentBeforeCopy', array($this->option . '.' . $this->name, $table, $oldTable, $copy_option_arr));
if (in_array(false, $result, true)) {
$this->setError($table->getError());
return false;
}
if ($table->store()) {
$table->checkIn();
$total_copied_listings++;
} else {
continue;
}
$newListingId = $table->id;
$query = "INSERT INTO #__judirectory_listings_xref (listing_id, cat_id, main) VALUES({$newListingId}, {$tocat_id}, 1)";
$db->setQuery($query);
$db->execute();
$ori_fieldgroup_id = JUDirectoryHelper::getFieldGroupIdByListingId($listing_id);
$copy_extra_fields = in_array("copy_extra_fields", $copy_option_arr);
if ($copy_extra_fields) {
$copy_extra_fields = $ori_fieldgroup_id == $catTable->fieldgroup_id ? true : false;
}
$query = $db->getQuery(true);
$query->select("field.*");
$query->from("#__judirectory_fields AS field");
$query->select("plg.folder");
$query->join("", "#__judirectory_plugins AS plg ON field.plugin_id = plg.id");
if ($copy_extra_fields && $ori_fieldgroup_id) {
$query->where("field.group_id IN (1, {$ori_fieldgroup_id})");
} else {
$query->where("field.group_id = 1");
}
$query->order('field.group_id, field.ordering');
$db->setQuery($query);
$fields = $db->loadObjectList();
foreach ($fields as $field) {
$fieldObj = JUDirectoryFrontHelperField::getField($field, $listing_id);
$fieldObj->onCopy($newListingId, $fieldsData);
}
if (in_array('copy_related_listings', $copy_option_arr)) {
$query = "INSERT INTO `#__judirectory_listings_relations` (listing_id, listing_id_related, ordering) SELECT {$newListingId}, listing_id_related, ordering FROM `#__judirectory_listings_relations` WHERE listing_id = {$listing_id}";
$db->setQuery($query);
$db->execute();
}
if (in_array('copy_rates', $copy_option_arr)) {
$ratingMapping = array();
$query = "SELECT * FROM #__judirectory_rating WHERE listing_id = {$listing_id}";
$db->setQuery($query);
$ratings = $db->loadObjectList();
if (count($ratings)) {