Пример #1
0
 /**
  * buildOperations
  *
  * @param BasicOperationCollection $operationCollection
  * @param array                    $operationServiceNames
  * @param Options                  $operationOptions
  * @param Options                  $operationPriorities
  *
  * @return void
  */
 protected function buildOperations(BasicOperationCollection $operationCollection, array $operationServiceNames, Options $operationOptions, Options $operationPriorities)
 {
     $queue = new \SplPriorityQueue();
     $defaultPriority = count($operationServiceNames);
     foreach ($operationServiceNames as $name => $middlewareService) {
         // Allows over-riding with nulls
         if (empty($middlewareService)) {
             continue;
         }
         $priority = $operationPriorities->get($name);
         if (empty($priority)) {
             $priority = $defaultPriority;
             $defaultPriority--;
         }
         $queue->insert($name, $priority);
     }
     foreach ($queue as $name) {
         $operationCollection->addOperation($this->buildOperation($name, $this->serviceManager->get($operationServiceNames[$name]), $operationOptions->getOptions($name), $operationPriorities->get($name, 0)));
     }
 }
Пример #2
0
 /**
  * buildPropertyListOption
  *
  * @param Request $request
  * @param Options $options
  *
  * @return void
  */
 public function buildPropertyListOption(Request $request, Options $options)
 {
     $filterPropertyList = $this->getFilterPropertyList($request, null);
     $propertyListMerged = $options->get('propertyListMerged', false);
     // Nothing to be done
     if ($filterPropertyList === null && $propertyListMerged) {
         return;
     }
     $defaultPropertyList = $options->get('propertyList', []);
     if (empty($defaultPropertyList)) {
         $options->set('propertyList', $filterPropertyList);
         return;
     }
     $list = $this->buildPropertyList($defaultPropertyList, $filterPropertyList);
     $options->set('propertyList', $list);
     $options->set('propertyListMerged', true);
 }
Пример #3
0
 /**
  * getPropertyDepthLimit
  *
  * @param Options $options
  * @param int     $default
  *
  * @return int
  */
 public function getPropertyDepthLimit(Options $options, $default = 1)
 {
     return (int) $options->get('propertyDepthLimit', $default);
 }