public function testOrder() { $this->executor->execute('default', ['en'], $this->builder)->willReturn([['uuid' => 1], ['uuid' => 2], ['uuid' => 3]]); $this->container = new InternalLinksContainer([2, 3, 1], $this->executor->reveal(), $this->builder->reveal(), [], new NullLogger(), 'default', 'en'); $result = $this->container->getData(); $this->assertEquals([['uuid' => 2], ['uuid' => 3], ['uuid' => 1]], $result); }
/** * {@inheritdoc} */ public function getNodesByIds($ids, $webspaceKey, $languageCode) { $result = []; $idString = ''; if (!empty($ids)) { $container = new InternalLinksContainer($ids, $this->queryExecutor, $this->queryBuilder, [], $this->logger, $webspaceKey, $languageCode); $result = $container->getData(); $idString = implode(',', $ids); } return ['_embedded' => ['nodes' => $result], 'total' => count($result), '_links' => ['self' => ['href' => $this->apiBasePath . '?ids=' . $idString]]]; }
/** * {@inheritdoc} */ public function getContentData(PropertyInterface $property) { $data = $property->getValue(); $container = new InternalLinksContainer(isset($data) ? $data : [], $this->contentQueryExecutor, $this->contentQueryBuilder, array_merge($this->getDefaultParams(), $property->getParams()), $this->logger, $property->getStructure()->getWebspaceKey(), $property->getStructure()->getLanguageCode(), $this->showDrafts); return $container->getData(); }