本文整理汇总了PHP中Alias::ival方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::ival方法的具体用法?PHP Alias::ival怎么用?PHP Alias::ival使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::ival方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$alias_url = $category->val('alias_url');
unset($category->data['alias_url']);
$category->save();
$alias = new Alias($db, $category->ival('category_alias_id'));
// save alias if new or changed
if ($alias->val('alias_url') != $alias_url || !$alias->is_loaded) {
$alias->data['alias_path'] = $category->getAliasPath();
if (isset($alias_url) && strlen(trim($alias_url)) > 0) {
$alias->setUrl($alias_url);
} else {
$alias->setUrl($category->getAliasUrl());
}
$alias->save();
}
// update category alias if changed
if ($alias->ival('alias_id') != $category->ival('category_alias_id')) {
$category->data['category_alias_id'] = $alias->ival('alias_id');
$category->save();
}
$category->alias = $alias;
} elseif (isset($path[2]) && $path[2] == 'edit') {
$category = new Category($db, $path[3]);
$category->alias = new Alias($db, $category->val('category_alias_id'));
$page_title = t('Editing Category');
} elseif (isset($path[2]) && $path[2] == 'delete') {
$category = new Category($db);
$category->deleteById($path[3]);
redirect('/admin/categories');
} else {
$category = new Category($db);
$page_title = t('New Category');
示例2: Alias
$zCategory = $category;
}
}
if (isset($zCategory)) {
$zProduct->data['product_category_id'] = $zCategory->ival('category_id');
$zProduct->data['product_name'] = $product_name;
$zProduct->data['product_price'] = $product_price;
$zProduct->data['product_stock'] = $product_stock;
$zProduct->save();
// update alias
$a = new Alias($db, $zProduct->val('product_alias_id'));
if (!$a->is_loaded) {
$a->setUrl($zProduct->getAliasUrl());
$a->data['alias_path'] = $zProduct->getAliasPath();
$a->save();
$zProduct->data['product_alias_id'] = $a->ival('alias_id');
$zProduct->save();
}
} else {
echo sprintf('Cannot find category with ABX id %s for product "%s"<br/>', $cat, $product_name);
}
}
}
// if $save_product
if (isset($zVariant) && $zProduct->val('product_id') != null) {
$zVariant->data['product_variant_ext_id'] = $prod_id;
$zVariant->data['product_variant_name'] = $variant_name;
$zVariant->data['product_variant_product_id'] = $zProduct->ival('product_id');
$zVariant->data['product_variant_price'] = $product_price;
$zVariant->data['product_variant_stock'] = $product_stock;
try {