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


PHP PersistenceManagerInterface::convertObjectsToIdentityArrays方法代码示例

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


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

示例1: forward

 /**
  * Forwards the request to another action and / or controller.
  *
  * Request is directly transferred to the other action / controller
  *
  * @param string $actionName Name of the action to forward to
  * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
  * @param string $packageKey Key of the package containing the controller to forward to. May also contain the sub package, concatenated with backslash (Vendor.Foo\Bar\Baz). If not specified, the current package is assumed.
  * @param array $arguments Arguments to pass to the target action
  * @return void
  * @throws \TYPO3\Flow\Mvc\Exception\ForwardException
  * @see redirect()
  * @api
  */
 protected function forward($actionName, $controllerName = null, $packageKey = null, array $arguments = array())
 {
     $nextRequest = clone $this->request;
     $nextRequest->setControllerActionName($actionName);
     if ($controllerName !== null) {
         $nextRequest->setControllerName($controllerName);
     }
     if ($packageKey !== null && strpos($packageKey, '\\') !== false) {
         list($packageKey, $subpackageKey) = explode('\\', $packageKey, 2);
     } else {
         $subpackageKey = null;
     }
     if ($packageKey !== null) {
         $nextRequest->setControllerPackageKey($packageKey);
     }
     if ($subpackageKey !== null) {
         $nextRequest->setControllerSubpackageKey($subpackageKey);
     }
     $regularArguments = array();
     foreach ($arguments as $argumentName => $argumentValue) {
         if (substr($argumentName, 0, 2) === '__') {
             $nextRequest->setArgument($argumentName, $argumentValue);
         } else {
             $regularArguments[$argumentName] = $argumentValue;
         }
     }
     $nextRequest->setArguments($this->persistenceManager->convertObjectsToIdentityArrays($regularArguments));
     $this->arguments->removeAll();
     $forwardException = new \TYPO3\Flow\Mvc\Exception\ForwardException();
     $forwardException->setNextRequest($nextRequest);
     throw $forwardException;
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:46,代码来源:AbstractController.php

示例2: resolveValue

 /**
  * Iterate through the configured modules, find the matching module and set
  * the route path accordingly
  *
  * @param array $value (contains action, controller and package of the module controller)
  * @return boolean
  */
 protected function resolveValue($value)
 {
     if (is_array($value)) {
         $this->value = isset($value['@action']) && $value['@action'] !== 'index' ? $value['@action'] : '';
         if ($this->value !== '' && isset($value['@format'])) {
             $this->value .= '.' . $value['@format'];
         }
         $exceedingArguments = array();
         foreach ($value as $argumentKey => $argumentValue) {
             if (substr($argumentKey, 0, 1) !== '@' && substr($argumentKey, 0, 2) !== '__') {
                 $exceedingArguments[$argumentKey] = $argumentValue;
             }
         }
         if ($exceedingArguments !== array()) {
             $exceedingArguments = Arrays::removeEmptyElementsRecursively($exceedingArguments);
             $exceedingArguments = $this->persistenceManager->convertObjectsToIdentityArrays($exceedingArguments);
             $queryString = http_build_query(array($this->name => $exceedingArguments), null, '&');
             if ($queryString !== '') {
                 $this->value .= '?' . $queryString;
             }
         }
     }
     return true;
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:31,代码来源:BackendModuleArgumentsRoutePartHandler.php

示例3: resolves

 /**
  * Checks whether $routeValues can be resolved to a corresponding uri.
  * If all Route Parts can resolve one or more of the $routeValues, TRUE is
  * returned and $this->matchingURI contains the generated URI (excluding
  * protocol and host).
  *
  * @param array $routeValues An array containing key/value pairs to be resolved to uri segments
  * @return boolean TRUE if this Route corresponds to the given $routeValues, otherwise FALSE
  * @throws InvalidRoutePartValueException
  * @see getMatchingUri()
  */
 public function resolves(array $routeValues)
 {
     $this->resolvedUriPath = null;
     if ($this->uriPattern === null) {
         return false;
     }
     if (!$this->isParsed) {
         $this->parse();
     }
     $resolvedUriPath = '';
     $remainingDefaults = $this->defaults;
     $requireOptionalRouteParts = false;
     $matchingOptionalUriPortion = '';
     /** @var $routePart RoutePartInterface */
     foreach ($this->routeParts as $routePart) {
         if (!$routePart->resolve($routeValues)) {
             if (!$routePart->hasDefaultValue()) {
                 return false;
             }
         }
         if ($routePart->getName() !== null) {
             $remainingDefaults = Arrays::unsetValueByPath($remainingDefaults, $routePart->getName());
         }
         $routePartValue = null;
         if ($routePart->hasValue()) {
             $routePartValue = $routePart->getValue();
             if (!is_string($routePartValue)) {
                 throw new InvalidRoutePartValueException('RoutePart::getValue() must return a string after calling RoutePart::resolve(), got ' . (is_object($routePartValue) ? get_class($routePartValue) : gettype($routePartValue)) . ' for RoutePart "' . get_class($routePart) . '" in Route "' . $this->getName() . '".');
             }
         }
         $routePartDefaultValue = $routePart->getDefaultValue();
         if ($routePartDefaultValue !== null && !is_string($routePartDefaultValue)) {
             throw new InvalidRoutePartValueException('RoutePart::getDefaultValue() must return a string, got ' . (is_object($routePartDefaultValue) ? get_class($routePartDefaultValue) : gettype($routePartDefaultValue)) . ' for RoutePart "' . get_class($routePart) . '" in Route "' . $this->getName() . '".');
         }
         if (!$routePart->isOptional()) {
             $resolvedUriPath .= $routePart->hasValue() ? $routePartValue : $routePartDefaultValue;
             $requireOptionalRouteParts = false;
             continue;
         }
         if ($routePart->hasValue() && strtolower($routePartValue) !== strtolower($routePartDefaultValue)) {
             $matchingOptionalUriPortion .= $routePartValue;
             $requireOptionalRouteParts = true;
         } else {
             $matchingOptionalUriPortion .= $routePartDefaultValue;
         }
         if ($requireOptionalRouteParts) {
             $resolvedUriPath .= $matchingOptionalUriPortion;
             $matchingOptionalUriPortion = '';
         }
     }
     if ($this->compareAndRemoveMatchingDefaultValues($remainingDefaults, $routeValues) !== true) {
         return false;
     }
     if (isset($routeValues['@format']) && $routeValues['@format'] === '') {
         unset($routeValues['@format']);
     }
     // add query string
     if (count($routeValues) > 0) {
         $routeValues = Arrays::removeEmptyElementsRecursively($routeValues);
         $routeValues = $this->persistenceManager->convertObjectsToIdentityArrays($routeValues);
         if (!$this->appendExceedingArguments) {
             $internalArguments = $this->extractInternalArguments($routeValues);
             if ($routeValues !== array()) {
                 return false;
             }
             $routeValues = $internalArguments;
         }
         $queryString = http_build_query($routeValues, null, '&');
         if ($queryString !== '') {
             $resolvedUriPath .= strpos($resolvedUriPath, '?') !== false ? '&' . $queryString : '?' . $queryString;
         }
     }
     $this->resolvedUriPath = $resolvedUriPath;
     return true;
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:86,代码来源:Route.php


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