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


PHP Categorie::get_filles方法代码示例

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


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

示例1: getCategories

 /**
  *  Return Categories list
  *  @param		int		$idCat		Id of Category, if 0 return Principal cats
  *  @return      array				Array with categories
  */
 public static function getCategories($idCat = 0)
 {
     global $db;
     switch ($idCat) {
         case 0:
             //devolver las categorias con nivel 1
             $objCat = new Categorie($db);
             //$cats=$objCat->get_full_arbo(0);
             $cats = $objCat->get_full_arbo($idCat);
             if (sizeof($cats) > 0) {
                 $retarray = array();
                 foreach ($cats as $key => $val) {
                     if ($val['level'] < 2) {
                         $val['image'] = self::getImageCategory($val['id']);
                         $val['thumb'] = self::getImageCategory($val['id']);
                         $retarray[] = $val;
                     }
                 }
                 return $retarray;
             }
             break;
         case $idCat > 0:
             $objCat = new Categorie($db);
             $result = $objCat->fetch($idCat);
             if ($result > 0) {
                 $cats = $objCat->get_filles($idCat);
                 //$cats = self::get_filles($idCat);
                 if (sizeof($cats) > 0) {
                     $retarray = array();
                     foreach ($cats as $val) {
                         $cat['id'] = $val->id;
                         $cat['label'] = $val->label;
                         $cat['fulllabel'] = $val->label;
                         $cat['fullpath'] = '_' . $val->id;
                         $cat['image'] = self::getImageCategory($val->id);
                         $cat['thumb'] = self::getImageCategory($val->id);
                         $retarray[] = $cat;
                     }
                     return $retarray;
                 }
             }
             break;
         default:
             return -1;
             break;
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:52,代码来源:pos.class.mañanero.php

示例2: _categories

function _categories($fk_parent = 0, $keyword = '')
{
    global $db, $conf;
    $TFille = array();
    if (!empty($keyword)) {
        $resultset = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie WHERE label LIKE '%" . addslashes($keyword) . "%' ORDER BY label");
        while ($obj = $db->fetch_object($resultset)) {
            $cat = new Categorie($db);
            $cat->fetch($obj->rowid);
            $TFille[] = $cat;
        }
    } else {
        $parent = new Categorie($db);
        if (empty($fk_parent)) {
            if (empty($conf->global->SPC_DO_NOT_LOAD_PARENT_CAT)) {
                $TFille = $parent->get_all_categories(0, true);
            }
        } else {
            $parent->fetch($fk_parent);
            $TFille = $parent->get_filles();
        }
    }
    return $TFille;
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_searchproductcategory,代码行数:24,代码来源:interface.php

示例3: getCategory

/**
 * Get category infos and children
 *
 * @param	array		$authentication		Array of authentication information
 * @param	int			$id					Id of object
 * @return	mixed
 */
function getCategory($authentication, $id)
{
    global $db, $conf, $langs;
    dol_syslog("Function: getCategory login=" . $authentication['login'] . " id=" . $id);
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    if (!$error && !$id) {
        $error++;
        $errorcode = 'BAD_PARAMETERS';
        $errorlabel = "Parameter id must be provided.";
    }
    if (!$error) {
        $fuser->getrights();
        if ($fuser->rights->categorie->lire) {
            $categorie = new Categorie($db);
            $result = $categorie->fetch($id);
            if ($result > 0) {
                $dir = !empty($conf->categorie->dir_output) ? $conf->categorie->dir_output : $conf->service->dir_output;
                $pdir = get_exdir($categorie->id, 2) . $categorie->id . "/photos/";
                $dir = $dir . '/' . $pdir;
                $cat = array('id' => $categorie->id, 'id_mere' => $categorie->id_mere, 'label' => $categorie->label, 'description' => $categorie->description, 'socid' => $categorie->socid, 'type' => $categorie->type, 'dir' => $pdir, 'photos' => $categorie->liste_photos($dir, $nbmax = 10));
                $cats = $categorie->get_filles();
                if (count($cats) > 0) {
                    foreach ($cats as $fille) {
                        $dir = !empty($conf->categorie->dir_output) ? $conf->categorie->dir_output : $conf->service->dir_output;
                        $pdir = get_exdir($fille->id, 2) . $fille->id . "/photos/";
                        $dir = $dir . '/' . $pdir;
                        $cat['filles'][] = array('id' => $fille->id, 'id_mere' => $categorie->id_mere, 'label' => $fille->label, 'description' => $fille->description, 'socid' => $fille->socid, 'type' => $fille->type, 'dir' => $pdir, 'photos' => $fille->liste_photos($dir, $nbmax = 10));
                    }
                }
                // Create
                $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'categorie' => $cat);
            } else {
                $error++;
                $errorcode = 'NOT_FOUND';
                $errorlabel = 'Object not found for id=' . $id;
            }
        } else {
            $error++;
            $errorcode = 'PERMISSION_DENIED';
            $errorlabel = 'User does not have permission for this request';
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    }
    return $objectresp;
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:61,代码来源:server_category.php


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