/** * @see ItemIdForQueryLookup::getItemIdsForQuery */ public function getItemIdsForQuery(Description $description, QueryOptions $queryOptions = null) { try { return $this->entityIdForQueryCache->fetch($description, $queryOptions, 'item'); } catch (OutOfBoundsException $e) { $itemIds = $this->itemIdForQueryLookup->getItemIdsForQuery($description, $queryOptions); $this->entityIdForQueryCache->save($description, $queryOptions, 'item', $itemIds); return $itemIds; } }
public function testFetchWithException() { $this->setExpectedException('\\OutOfBoundsException'); $cache = new EntityIdForQueryCache(new ArrayCache()); $cache->fetch(new AnyValue(), null, 'item'); }