Skip to content

Commit

Permalink
Rename class Content to ContentRichEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Dec 13, 2019
1 parent 8ac7361 commit bcbaba1
Show file tree
Hide file tree
Showing 30 changed files with 109 additions and 109 deletions.
10 changes: 5 additions & 5 deletions Content/Application/ContentCopier/ContentCopier.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Sulu\Bundle\ContentBundle\Content\Application\ViewResolver\ApiViewResolverInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\ViewFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

class ContentCopier implements ContentCopierInterface
Expand Down Expand Up @@ -56,9 +56,9 @@ public function __construct(
}

public function copy(
ContentInterface $sourceContent,
ContentRichEntityInterface $sourceContent,
array $sourceDimensionAttributes,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface {
$sourceContentView = $this->contentLoader->load($sourceContent, $sourceDimensionAttributes);
Expand All @@ -68,7 +68,7 @@ public function copy(

public function copyFromContentDimensionCollection(
ContentDimensionCollectionInterface $contentDimensionCollection,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface {
$sourceContentView = $this->viewFactory->create($contentDimensionCollection);
Expand All @@ -78,7 +78,7 @@ public function copyFromContentDimensionCollection(

public function copyFromContentView(
ContentViewInterface $sourceContentView,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface {
$data = $this->contentResolver->resolve($sourceContentView);
Expand Down
10 changes: 5 additions & 5 deletions Content/Application/ContentCopier/ContentCopierInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Sulu\Bundle\ContentBundle\Content\Application\ContentCopier;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

interface ContentCopierInterface
Expand All @@ -24,9 +24,9 @@ interface ContentCopierInterface
* @param mixed[] $targetDimensionAttributes
*/
public function copy(
ContentInterface $sourceContent,
ContentRichEntityInterface $sourceContent,
array $sourceDimensionAttributes,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface;

Expand All @@ -35,7 +35,7 @@ public function copy(
*/
public function copyFromContentDimensionCollection(
ContentDimensionCollectionInterface $contentDimensionCollection,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface;

Expand All @@ -44,7 +44,7 @@ public function copyFromContentDimensionCollection(
*/
public function copyFromContentView(
ContentViewInterface $sourceContentView,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollection;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentDimensionRepositoryInterface;
Expand All @@ -47,7 +47,7 @@ public function __construct(ContentDimensionRepositoryInterface $contentDimensio
}

public function create(
ContentInterface $content,
ContentRichEntityInterface $content,
DimensionCollectionInterface $dimensionCollection,
array $data
): ContentDimensionCollectionInterface {
Expand Down Expand Up @@ -97,7 +97,7 @@ public function create(
}

private function getOrCreateContentDimension(
ContentInterface $content,
ContentRichEntityInterface $content,
Collection $contentDimensions,
DimensionInterface $dimension
): ContentDimensionInterface {
Expand Down
12 changes: 6 additions & 6 deletions Content/Application/ContentFacade/ContentFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Sulu\Bundle\ContentBundle\Content\Application\ContentPersister\ContentPersisterInterface;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\ContentWorkflowInterface;
use Sulu\Bundle\ContentBundle\Content\Application\ViewResolver\ApiViewResolverInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

class ContentFacade implements ContentFacadeInterface
Expand Down Expand Up @@ -62,12 +62,12 @@ public function __construct(
$this->contentWorkflow = $contentWorkflow;
}

public function load(ContentInterface $content, array $dimensionAttributes): ContentViewInterface
public function load(ContentRichEntityInterface $content, array $dimensionAttributes): ContentViewInterface
{
return $this->contentLoader->load($content, $dimensionAttributes);
}

public function persist(ContentInterface $content, array $data, array $dimensionAttributes): ContentViewInterface
public function persist(ContentRichEntityInterface $content, array $data, array $dimensionAttributes): ContentViewInterface
{
return $this->contentPersister->persist($content, $data, $dimensionAttributes);
}
Expand All @@ -78,9 +78,9 @@ public function resolve(ContentViewInterface $contentView): array
}

public function copy(
ContentInterface $sourceContent,
ContentRichEntityInterface $sourceContent,
array $sourceDimensionAttributes,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface {
return $this->contentCopier->copy(
Expand All @@ -92,7 +92,7 @@ public function copy(
}

public function applyTransition(
ContentInterface $content,
ContentRichEntityInterface $content,
array $dimensionAttributes,
string $transitionName
): ContentViewInterface {
Expand Down
12 changes: 6 additions & 6 deletions Content/Application/ContentFacade/ContentFacadeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

namespace Sulu\Bundle\ContentBundle\Content\Application\ContentFacade;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

interface ContentFacadeInterface
{
/**
* @param mixed[] $dimensionAttributes
*/
public function load(ContentInterface $content, array $dimensionAttributes): ContentViewInterface;
public function load(ContentRichEntityInterface $content, array $dimensionAttributes): ContentViewInterface;

/**
* @param mixed[] $data
* @param mixed[] $dimensionAttributes
*/
public function persist(ContentInterface $content, array $data, array $dimensionAttributes): ContentViewInterface;
public function persist(ContentRichEntityInterface $content, array $data, array $dimensionAttributes): ContentViewInterface;

/**
* @return mixed[]
Expand All @@ -39,17 +39,17 @@ public function resolve(ContentViewInterface $contentView): array;
* @param mixed[] $targetDimensionAttributes
*/
public function copy(
ContentInterface $sourceContent,
ContentRichEntityInterface $sourceContent,
array $sourceDimensionAttributes,
ContentInterface $targetContent,
ContentRichEntityInterface $targetContent,
array $targetDimensionAttributes
): ContentViewInterface;

/**
* @param mixed[] $dimensionAttributes
*/
public function applyTransition(
ContentInterface $content,
ContentRichEntityInterface $content,
array $dimensionAttributes,
string $transitionName
): ContentViewInterface;
Expand Down
4 changes: 2 additions & 2 deletions Content/Application/ContentLoader/ContentLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Sulu\Bundle\ContentBundle\Content\Domain\Exception\ContentNotFoundException;
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\ViewFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentDimensionRepositoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Repository\DimensionRepositoryInterface;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function __construct(
$this->viewFactory = $viewFactory;
}

public function load(ContentInterface $content, array $dimensionAttributes): ContentViewInterface
public function load(ContentRichEntityInterface $content, array $dimensionAttributes): ContentViewInterface
{
$dimensionCollection = $this->dimensionRepository->findByAttributes($dimensionAttributes);

Expand Down
4 changes: 2 additions & 2 deletions Content/Application/ContentLoader/ContentLoaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

namespace Sulu\Bundle\ContentBundle\Content\Application\ContentLoader;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

interface ContentLoaderInterface
{
/**
* @param mixed[] $dimensionAttributes
*/
public function load(ContentInterface $content, array $dimensionAttributes): ContentViewInterface;
public function load(ContentRichEntityInterface $content, array $dimensionAttributes): ContentViewInterface;
}
4 changes: 2 additions & 2 deletions Content/Application/ContentPersister/ContentPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\ContentDimensionCollectionFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\DimensionCollectionFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\ViewFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

class ContentPersister implements ContentPersisterInterface
Expand Down Expand Up @@ -52,7 +52,7 @@ public function __construct(
$this->viewFactory = $viewFactory;
}

public function persist(ContentInterface $content, array $data, array $dimensionAttributes): ContentViewInterface
public function persist(ContentRichEntityInterface $content, array $data, array $dimensionAttributes): ContentViewInterface
{
$dimensionCollection = $this->dimensionCollectionFactory->create($dimensionAttributes);
$contentDimensionCollection = $this->contentDimensionCollectionFactory->create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sulu\Bundle\ContentBundle\Content\Application\ContentPersister;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

interface ContentPersisterInterface
Expand All @@ -22,5 +22,5 @@ interface ContentPersisterInterface
* @param mixed[] $data
* @param mixed[] $dimensionAttributes
*/
public function persist(ContentInterface $content, array $data, array $dimensionAttributes): ContentViewInterface;
public function persist(ContentRichEntityInterface $content, array $data, array $dimensionAttributes): ContentViewInterface;
}
4 changes: 2 additions & 2 deletions Content/Application/ContentWorkflow/ContentWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Sulu\Bundle\ContentBundle\Content\Domain\Exception\ContentNotExistTransitionException;
use Sulu\Bundle\ContentBundle\Content\Domain\Exception\ContentNotFoundException;
use Sulu\Bundle\ContentBundle\Content\Domain\Factory\ViewFactoryInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\WorkflowInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Repository\ContentDimensionRepositoryInterface;
Expand Down Expand Up @@ -81,7 +81,7 @@ public function __construct(
}

public function apply(
ContentInterface $content,
ContentRichEntityInterface $content,
array $dimensionAttributes,
string $transitionName
): ContentViewInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentViewInterface;

interface ContentWorkflowInterface
Expand All @@ -22,7 +22,7 @@ interface ContentWorkflowInterface
* @param mixed[] $dimensionAttributes
*/
public function apply(
ContentInterface $content,
ContentRichEntityInterface $content,
array $dimensionAttributes,
string $transitionName
): ContentViewInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Sulu\Bundle\ContentBundle\Content\Application\ContentCopier\ContentCopierInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\TransitionEvent;
Expand Down Expand Up @@ -55,7 +55,7 @@ public function onPublish(TransitionEvent $transitionEvent): void
throw new \RuntimeException('No "contentDimensionCollection" given.');
}

if (!$content instanceof ContentInterface) {
if (!$content instanceof ContentRichEntityInterface) {
throw new \RuntimeException('No "contentRichEntity" given.');
}

Expand Down
4 changes: 2 additions & 2 deletions Content/Domain/Exception/ContentNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Sulu\Bundle\ContentBundle\Content\Domain\Exception;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;

class ContentNotFoundException extends \Exception
{
public function __construct(ContentInterface $content, array $dimensionAttributes)
public function __construct(ContentRichEntityInterface $content, array $dimensionAttributes)
{
parent::__construct(sprintf(
'Could not load content with id "%s" and attributes: %s',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Sulu\Bundle\ContentBundle\Content\Domain\Factory;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionCollectionInterface;

interface ContentDimensionCollectionFactoryInterface
Expand All @@ -23,7 +23,7 @@ interface ContentDimensionCollectionFactoryInterface
* @param array<string, mixed> $data
*/
public function create(
ContentInterface $content,
ContentRichEntityInterface $content,
DimensionCollectionInterface $dimensionCollection,
array $data
): ContentDimensionCollectionInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sulu\Bundle\ContentBundle\Content\Domain\Model;

abstract class AbstractContent implements ContentInterface
abstract class AbstractContentRichEntity implements ContentRichEntityInterface
{
use ContentTrait;
use ContentRichEntityTrait;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Doctrine\Common\Collections\Collection;

interface ContentInterface
interface ContentRichEntityInterface
{
public static function getResourceKey(): string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;

trait ContentTrait
trait ContentRichEntityTrait
{
/**
* @var ContentDimensionInterface[]|ArrayCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
namespace Sulu\Bundle\ContentBundle\Content\Domain\Repository;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentDimensionCollectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionCollectionInterface;

interface ContentDimensionRepositoryInterface
{
public function load(
ContentInterface $content,
ContentRichEntityInterface $content,
DimensionCollectionInterface $dimensionCollection
): ContentDimensionCollectionInterface;
}
Loading

0 comments on commit bcbaba1

Please sign in to comment.