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


PHP Repository::setInferOptionsFromParent方法代码示例

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


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

示例1: repoFromDb

 /**
  * Create a Repository object from a Database Result
  *
  * The method expects the following schema:
  * CREATE TABLE ajxp_repo ( uuid VARCHAR(33) PRIMARY KEY,
  *                             path VARCHAR(255),
  *                             display VARCHAR(255),
  *                             accessType VARCHAR(20),
  *                             recycle VARCHAR(255) ,
  *                             bcreate BOOLEAN, -- For some reason 'create' is a reserved keyword
  *                             writeable BOOLEAN,
  *                             enabled BOOLEAN );
  *
  * Additionally, the options are stored in a separate table:
  * CREATE TABLE ajxp_repo_options ( oid INTEGER PRIMARY KEY, uuid VARCHAR(33), name VARCHAR(50), val VARCHAR(255) );
  *
  * I recommend an index to increase performance of uuid lookups:
  * CREATE INDEX ajxp_repo_options_uuid_idx ON ajxp_repo_options ( uuid );
  *
  *
  * @param $result Result of a dibi::query() as array
  * @param array|\Result $options_result Result of dibi::query() for options as array
  * @return Repository object
  */
 public function repoFromDb($result, $options_result = array())
 {
     $repo = new Repository($result['id'], $result['display'], $result['accessType']);
     $repo->uuid = $result['uuid'];
     $repo->setOwnerData($result['parent_uuid'], $result['owner_user_id'], $result['child_user_id']);
     $repo->path = $result['path'];
     $repo->create = (bool) $result['bcreate'];
     $repo->writeable = (bool) $result['writeable'];
     $repo->enabled = (bool) $result['enabled'];
     $repo->recycle = "";
     $repo->setSlug($result['slug']);
     if (isset($result['groupPath']) && !empty($result['groupPath'])) {
         $repo->setGroupPath($result['groupPath']);
     }
     $repo->isTemplate = (bool) $result['isTemplate'];
     $repo->setInferOptionsFromParent((bool) $result['inferOptionsFromParent']);
     foreach ($options_result as $k => $v) {
         if (strpos($v, '$phpserial$') !== false && strpos($v, '$phpserial$') === 0) {
             $v = unserialize(substr($v, strlen('$phpserial$')));
         } else {
             if ($k == "META_SOURCES") {
                 $v = unserialize($v);
             }
         }
         $repo->options[$k] = $v;
     }
     if (isset($repo->options["content_filter"]) && is_a($repo->options["content_filter"], "ContentFilter")) {
         $repo->setContentFilter($repo->options["content_filter"]);
     }
     return $repo;
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:55,代码来源:class.sqlConfDriver.php

示例2: repoFromDb

 /**
  * Create a Repository object from a Database Result
  * 
  * The method expects the following schema:
  * CREATE TABLE ajxp_repo ( uuid VARCHAR(33) PRIMARY KEY, 
  * 							path VARCHAR(255), 
  * 							display VARCHAR(255), 
  * 							accessType VARCHAR(20), 
  * 							recycle VARCHAR(255) , 
  * 							bcreate BOOLEAN, -- For some reason 'create' is a reserved keyword
  * 							writeable BOOLEAN, 
  * 							enabled BOOLEAN );
  * 
  * Additionally, the options are stored in a separate table:
  * CREATE TABLE ajxp_repo_options ( oid INTEGER PRIMARY KEY, uuid VARCHAR(33), name VARCHAR(50), val VARCHAR(255) );
  * 
  * I recommend an index to increase performance of uuid lookups:
  * CREATE INDEX ajxp_repo_options_uuid_idx ON ajxp_repo_options ( uuid );
  * 
  * 
  * @param $result Result of a dibi::query() as array
  * @param $options_result Result of dibi::query() for options as array
  * @return Repository object
  */
 function repoFromDb($result, $options_result = array())
 {
     $repo = new Repository($result['id'], $result['display'], $result['accessType']);
     $repo->uuid = $result['uuid'];
     $repo->setOwnerData($result['parent_uuid'], $result['owner_user_id'], $result['child_user_id']);
     $repo->path = $result['path'];
     $repo->create = $result['bcreate'];
     $repo->writeable = $result['writeable'];
     $repo->writeable = true;
     $repo->enabled = $result['enabled'];
     $repo->recycle = "";
     $repo->setSlug($result['slug']);
     $repo->isTemplate = intval($result['isTemplate']) == 1 ? true : false;
     $repo->setInferOptionsFromParent(intval($result['inferOptionsFromParent']) == 1 ? true : false);
     foreach ($options_result as $k => $v) {
         if (strpos($v, '$phpserial$') !== false && strpos($v, '$phpserial$') === 0) {
             $v = unserialize(substr($v, strlen('$phpserial$')));
         } else {
             if ($k == "META_SOURCES") {
                 $v = unserialize($v);
             }
         }
         $repo->options[$k] = $v;
     }
     return $repo;
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:50,代码来源:class.sqlConfDriver.php

示例3: createTemplateChild

 /**
  * Create a child from this repository if it's a template
  * @param string $newLabel
  * @param array $newOptions
  * @param string $owner
  * @param string $uniqueUser
  * @return Repository
  */
 public function createTemplateChild($newLabel, $newOptions, $owner = null, $uniqueUser = null)
 {
     $repo = new Repository(0, $newLabel, $this->accessType);
     $newOptions["CREATION_TIME"] = time();
     if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
         $newOptions["CREATION_USER"] = AuthService::getLoggedUser()->getId();
     }
     $repo->options = $newOptions;
     $repo->setOwnerData($this->getId(), $owner, $uniqueUser);
     $repo->setInferOptionsFromParent(true);
     return $repo;
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:20,代码来源:class.Repository.php

示例4: createTemplateChild

 /**
  * Create a child from this repository if it's a template
  * @param string $newLabel
  * @param array $newOptions
  * @param string $owner
  * @param string $uniqueUser
  * @return Repository
  */
 public function createTemplateChild($newLabel, $newOptions, $owner = null, $uniqueUser = null)
 {
     $repo = new Repository(0, $newLabel, $this->accessType);
     $repo->options = $newOptions;
     $repo->setOwnerData($this->getId(), $owner, $uniqueUser);
     $repo->setInferOptionsFromParent(true);
     return $repo;
 }
开发者ID:biggtfish,项目名称:cms,代码行数:16,代码来源:class.Repository.php


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