Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/Contract/Lib/Tools/FrontendResolverContract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);

/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

namespace Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools;

use Pimcore\Model\Document;
use Pimcore\Model\Site;
use Pimcore\Tool\Frontend;

class FrontendResolverContract implements FrontendResolverContractInterface
{
public function isDocumentInSite(?Site $site, Document $document): bool
{
return Frontend::isDocumentInSite($site, $document);
}

public function isDocumentInCurrentSite(Document $document): bool
{
return Frontend::isDocumentInCurrentSite($document);
}

public function getSiteForDocument(Document $document): ?Site
{
return Frontend::getSiteForDocument($document);
}

public function getSiteIdForDocument(Document $document): ?int
{
return Frontend::getSiteIdForDocument($document);
}

/**
* @return false|array{enabled: true, lifetime: int|null}
*/
public function isOutputCacheEnabled(): bool|array
{
return Frontend::isOutputCacheEnabled();
}
}
33 changes: 33 additions & 0 deletions src/Contract/Lib/Tools/FrontendResolverContractInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);

/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

namespace Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools;

use Pimcore\Model\Document;
use Pimcore\Model\Site;

interface FrontendResolverContractInterface
{
public function isDocumentInSite(?Site $site, Document $document): bool;

public function isDocumentInCurrentSite(Document $document): bool;

public function getSiteForDocument(Document $document): ?Site;

public function getSiteIdForDocument(Document $document): ?int;

/**
* @return false|array{enabled: true, lifetime: int|null}
*/
public function isOutputCacheEnabled(): bool|array;
}
23 changes: 23 additions & 0 deletions src/Lib/Tools/FrontendResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);

/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

namespace Pimcore\Bundle\StaticResolverBundle\Lib\Tools;

use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools\FrontendResolverContract;

/**
* @internal
*/
final class FrontendResolver extends FrontendResolverContract implements FrontendResolverInterface
{
}
23 changes: 23 additions & 0 deletions src/Lib/Tools/FrontendResolverInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);

/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

namespace Pimcore\Bundle\StaticResolverBundle\Lib\Tools;

use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\Tools\FrontendResolverContractInterface;

/**
* @internal
*/
interface FrontendResolverInterface extends FrontendResolverContractInterface
{
}