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


PHP Process::getAllProcessesByCategory方法代码示例

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


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

示例1: trim

         $catName = trim($_REQUEST['category']);
         $pcat = new ProcessCategory();
         $pcat->setNew(false);
         $pcat->setCategoryUid($catUID);
         $pcat->setCategoryName($catName);
         $pcat->save();
         g::auditLog("UpdateCategory", "Category Name: " . $catName . " Category ID: (" . $catUID . ") ");
         echo '{success: true}';
     } catch (Exception $ex) {
         echo '{success: false, error: ' . $ex->getMessage() . '}';
     }
     break;
 case 'canDeleteCategory':
     require_once 'classes/model/Process.php';
     $proc = new Process();
     $aProcess = $proc->getAllProcessesByCategory();
     $catUID = $_REQUEST['CAT_UID'];
     $response = isset($aProcess[$catUID]) ? 'false' : 'true';
     echo $response;
     break;
 case 'deleteCategory':
     try {
         require_once 'classes/model/ProcessCategory.php';
         $catUID = $_REQUEST['cat_uid'];
         $cat = new ProcessCategory();
         $cat->setCategoryUid($catUID);
         $catName = $cat->loadByCategoryId($catUID);
         $cat->delete();
         G::auditLog("DeleteCategory", "Category Name: " . $catName . " Category ID: (" . $catUID . ") ");
         echo '{success: true}';
     } catch (Exception $ex) {
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:processCategory_Ajax.php

示例2: getCategory

 /**
  * Get data of a Category
  *
  * @param string $categoryUid   Unique id of Category
  * @param bool   $flagGetRecord Value that set the getting
  *
  * return array Return an array with data of a Category
  */
 public function getCategory($categoryUid, $flagGetRecord = false)
 {
     try {
         //Verify data
         $this->throwExceptionIfNotExistsCategory($categoryUid, $this->arrayFieldNameForException["categoryUid"]);
         //Set variables
         if (!$flagGetRecord) {
             $process = new \Process();
             $arrayTotalProcessesByCategory = $process->getAllProcessesByCategory();
         }
         //Get data
         //SQL
         $criteria = $this->getCategoryCriteria();
         $criteria->add(\ProcessCategoryPeer::CATEGORY_UID, $categoryUid, \Criteria::EQUAL);
         $rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria);
         $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $rsCriteria->next();
         $row = $rsCriteria->getRow();
         if (!$flagGetRecord) {
             $row["CATEGORY_TOTAL_PROCESSES"] = isset($arrayTotalProcessesByCategory[$row["CATEGORY_UID"]]) ? (int) $arrayTotalProcessesByCategory[$row["CATEGORY_UID"]] : 0;
         }
         //Return
         return !$flagGetRecord ? $this->getCategoryDataFromRecord($row) : $row;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:35,代码来源:ProcessCategory.php


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