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


PHP Alias::ival方法代码示例

本文整理汇总了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');
开发者ID:lotcz,项目名称:zshop,代码行数:31,代码来源:category.c.php

示例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 {
开发者ID:lotcz,项目名称:zshop,代码行数:31,代码来源:abx.j.php


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