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


PHP PermissionKeyCategory::getByID方法代码示例

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


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

示例1: getPermissionKeyToolsURL

 public function getPermissionKeyToolsURL($task = false)
 {
     if (!$task) {
         $task = 'save_permission';
     }
     $uh = Loader::helper('concrete/urls');
     $class = substr(get_class($this), 0, strrpos(get_class($this), 'PermissionAssignment'));
     $handle = Loader::helper('text')->uncamelcase($class);
     if ($handle) {
         $akc = PermissionKeyCategory::getByHandle($handle);
     } else {
         $akc = PermissionKeyCategory::getByID($this->pk->getPermissionKeyCategoryID());
     }
     $url = $uh->getToolsURL('permissions/categories/' . $akc->getPermissionKeyCategoryHandle(), $akc->getPackageHandle());
     $token = Loader::helper('validation/token')->getParameter($task);
     $url .= '?' . $token . '&task=' . $task . '&pkID=' . $this->pk->getPermissionKeyID();
     return $url;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:18,代码来源:assignment.php

示例2: getListByPackage

 /** 
  * Note, this queries both the pkgID found on the PermissionKeys table AND any permission keys of a special type
  * installed by that package, and any in categories by that package.
  */
 public static function getListByPackage($pkg)
 {
     $db = Loader::db();
     $kina[] = '-1';
     $kinb = $db->GetCol('select pkCategoryID from PermissionKeyCategories where pkgID = ?', $pkg->getPackageID());
     if (is_array($kinb)) {
         $kina = array_merge($kina, $kinb);
     }
     $kinstr = implode(',', $kina);
     $r = $db->Execute('select pkID, pkCategoryID from PermissionKeys where (pkgID = ? or pkCategoryID in (' . $kinstr . ')) order by pkID asc', array($pkg->getPackageID()));
     while ($row = $r->FetchRow()) {
         $pkc = PermissionKeyCategory::getByID($row['pkCategoryID']);
         $pk = $pkc->getPermissionKeyByID($row['pkID']);
         $list[] = $pk;
     }
     $r->Close();
     return $list;
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:22,代码来源:key.php

示例3: add

 public static function add($pkCategoryHandle, $pkg = false)
 {
     $db = Loader::db();
     if (is_object($pkg)) {
         $pkgID = $pkg->getPackageID();
     }
     $db->Execute('insert into PermissionKeyCategories (pkCategoryHandle, pkgID) values (?, ?)', array($pkCategoryHandle, $pkgID));
     $id = $db->Insert_ID();
     Cache::delete('permission_key_categories', false);
     return PermissionKeyCategory::getByID($id);
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:11,代码来源:category.php

示例4: add

	/** 
	 * Adds an permission key. 
	 */
	public function add($pkCategoryHandle, $pkHandle, $pkName, $pkDescription, $pkCanTriggerWorkflow, $pkHasCustomClass, $pkg = false) {
		
		$vn = Loader::helper('validation/numbers');
		$txt = Loader::helper('text');
		$pkgID = 0;
		$db = Loader::db();
		
		if (is_object($pkg)) {
			$pkgID = $pkg->getPackageID();
		}
		
		if ($pkCanTriggerWorkflow) {
			$pkCanTriggerWorkflow = 1;
		} else {
			$pkCanTriggerWorkflow = 0;
		}

		if ($pkHasCustomClass) {
			$pkHasCustomClass = 1;
		} else {
			$$pkHasCustomClass = 0;
		}
		$pkCategoryID = $db->GetOne("select pkCategoryID from PermissionKeyCategories where pkCategoryHandle = ?", $pkCategoryHandle);
		$a = array($pkHandle, $pkName, $pkDescription, $pkCategoryID, $pkCanTriggerWorkflow, $pkHasCustomClass, $pkgID);
		$r = $db->query("insert into PermissionKeys (pkHandle, pkName, pkDescription, pkCategoryID, pkCanTriggerWorkflow, pkHasCustomClass, pkgID) values (?, ?, ?, ?, ?, ?, ?)", $a);
		
		$category = PermissionKeyCategory::getByID($pkCategoryID);
		
		if ($r) {
			$pkID = $db->Insert_ID();
			$ak = self::load($pkID);
			return $ak;
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:37,代码来源:key.php


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