Skip to content

Commit

Permalink
Use RoutableStructureInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-rath committed Oct 18, 2022
1 parent bbe3c44 commit 0d36daa
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Sulu\Component\Content\Metadata\PropertyMetadata;
use Sulu\Component\Content\Metadata\StructureMetadata;

class ContentStructureBridge implements StructureInterface
class ContentStructureBridge implements StructureInterface, RoutableStructureInterface
{
/**
* @var StructureMetadata
Expand Down Expand Up @@ -130,6 +130,11 @@ public function getController(): ?string
return $this->structure->getController();
}

public function getCacheLifeTime()
{
return $this->structure->getCacheLifetime();
}

public function getCreator(): ?int
{
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

declare(strict_types=1);

/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\ContentBundle\Content\Infrastructure\Sulu\Structure;

use Sulu\Component\Content\Compat\RoutableStructureInterface as SuluRoutableStructureInterface;

if (\interface_exists(SuluRoutableStructureInterface::class)) {
/**
* @deprecated will be removed, as soon as the ArticleBundle rises the minimum requirement of sulu to a version,
* where this interface exists
*
* @internal
*/
interface RoutableStructureInterface extends SuluRoutableStructureInterface
{
}
} else {
/**
* @deprecated will be removed, as soon as the ArticleBundle rises the minimum requirement of sulu to a version,
* where this interface exists
*
* @internal
*/
interface RoutableStructureInterface
{
/**
* twig template of template definition.
*
* @return string
*/
public function getView();

/**
* controller which renders the twig template.
*
* @return string
*/
public function getController();

/**
* cacheLifeTime of template definition.
*
* @return array{
* type: string,
* value: string,
* }
*/
public function getCacheLifeTime();
}
}

0 comments on commit 0d36daa

Please sign in to comment.