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


PHP LocationService::loadLocationChildren方法代码示例

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


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

示例1: browseLocation

 /**
  * Prints out the location name, and recursively calls itself on each its children
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Location $location
  * @param int $depth The current depth
  *
  * @param OutputInterface $output
  */
 private function browseLocation(Location $location, OutputInterface $output, $depth = 0)
 {
     // indent according to depth and write out the name of the content
     $output->write(str_pad(' ', $depth));
     $output->writeln($location->contentInfo->name);
     // we request the location's children using the location service, and call browseLocation on each
     $childLocations = $this->locationService->loadLocationChildren($location);
     foreach ($childLocations->locations as $childLocation) {
         $this->browseLocation($childLocation, $output, $depth + 1);
     }
 }
开发者ID:haavardb,项目名称:CookbookBundle,代码行数:19,代码来源:BrowseLocationsCommand.php

示例2: loadLocationChildren

 /**
  * Loads child locations of a location
  *
  * @param string $locationPath
  *
  * @return \eZ\Publish\Core\REST\Server\Values\LocationList
  */
 public function loadLocationChildren($locationPath)
 {
     $offset = $this->request->query->has('offset') ? (int) $this->request->query->get('offset') : 0;
     $limit = $this->request->query->has('limit') ? (int) $this->request->query->get('limit') : -1;
     $restLocations = array();
     $locationId = $this->extractLocationIdFromPath($locationPath);
     foreach ($this->locationService->loadLocationChildren($this->locationService->loadLocation($locationId), $offset >= 0 ? $offset : 0, $limit >= 0 ? $limit : -1)->locations as $location) {
         $restLocations[] = new Values\RestLocation($location, $this->locationService->getLocationChildCount($location));
     }
     return new Values\CachedValue(new Values\LocationList($restLocations, $this->request->getPathInfo()), array('locationId' => $locationId));
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:18,代码来源:Location.php

示例3: loadLocationChildren

 /**
  * Loads children which are readable by the current user of a location object sorted by sortField and sortOrder
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Location $location
  * @param int $offset the start offset for paging
  * @param int $limit the number of locations returned
  *
  * @return \eZ\Publish\API\Repository\Values\Content\LocationList
  */
 public function loadLocationChildren(Location $location, $offset = 0, $limit = 10)
 {
     return $this->service->loadLocationChildren($location, $offset, $limit);
 }
开发者ID:nlescure,项目名称:ezpublish-kernel,代码行数:13,代码来源:LocationService.php


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