Skip to content

Commit

Permalink
Merge pull request #5044 from mhsdesign/task/removeAnnoyingContentGra…
Browse files Browse the repository at this point in the history
…phProjectionDecorator
  • Loading branch information
kitsunet committed May 20, 2024
2 parents 9063c1d + 28f78f5 commit a9ce232
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Timestamps;
use Neos\ContentRepository\Core\Projection\ProjectionInterface;
use Neos\ContentRepository\Core\Projection\ProjectionStatus;
use Neos\ContentRepository\Core\Projection\WithMarkStaleInterface;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
Expand All @@ -62,7 +63,7 @@
* @implements ProjectionInterface<ContentGraphFinder>
* @internal but the graph projection is api
*/
final class DoctrineDbalContentGraphProjection implements ProjectionInterface
final class DoctrineDbalContentGraphProjection implements ProjectionInterface, WithMarkStaleInterface
{
use NodeVariation;
use SubtreeTagging;
Expand Down Expand Up @@ -148,6 +149,11 @@ public function reset(): void
$this->getState()->forgetInstances();
}

public function markStale(): void
{
$this->getState()->forgetInstances();
}

private function truncateDatabaseTables(): void
{
$this->dbal->executeQuery('TRUNCATE table ' . $this->tableNames->node());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\ProjectionContentGraph;
use Neos\ContentRepository\Core\ContentGraphFinder;
use Neos\ContentRepository\Core\Factory\ProjectionFactoryDependencies;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphProjection;
use Neos\ContentRepository\Core\Projection\ProjectionFactoryInterface;

/**
* Use this class as ProjectionFactory in your configuration to construct a content graph
*
* @implements ProjectionFactoryInterface<ContentGraphProjection>
* @implements ProjectionFactoryInterface<DoctrineDbalContentGraphProjection>
*
* @api
*/
Expand All @@ -30,7 +29,7 @@ public function __construct(
public function build(
ProjectionFactoryDependencies $projectionFactoryDependencies,
array $options,
): ContentGraphProjection {
): DoctrineDbalContentGraphProjection {
$tableNames = ContentGraphTableNames::create(
$projectionFactoryDependencies->contentRepositoryId
);
Expand All @@ -52,17 +51,15 @@ public function build(
$tableNames
);

return new ContentGraphProjection(
new DoctrineDbalContentGraphProjection(
return new DoctrineDbalContentGraphProjection(
$this->dbal,
new ProjectionContentGraph(
$this->dbal,
new ProjectionContentGraph(
$this->dbal,
$tableNames
),
$tableNames,
$dimensionSpacePointsRepository,
new ContentGraphFinder($contentGraphFactory)
)
$tableNames
),
$tableNames,
$dimensionSpacePointsRepository,
new ContentGraphFinder($contentGraphFactory)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPublished;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceRebaseFailed;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceWasRebased;
use Neos\ContentRepository\Core\Projection\ProjectionInterface;
use Neos\EventStore\Model\Event;
use Neos\EventStore\Model\Event\EventData;
use Neos\EventStore\Model\Event\EventId;
Expand All @@ -52,7 +53,7 @@
* For normalizing (from classes to event store), this is called from {@see ContentRepository::normalizeEvent()}.
*
* For denormalizing (from event store to classes), this is called in the individual projections; f.e.
* {@see ContentGraphProjection::apply()}.
* {@see ProjectionInterface::apply()}.
*
* @api because inside projections, you get an instance of EventNormalizer to handle events.
*/
Expand Down

This file was deleted.

0 comments on commit a9ce232

Please sign in to comment.