Add 'plugi-core/' from commit '6c478c54d048ab2fd5af4e8e79074153fb594c16'

git-subtree-dir: plugi-core
git-subtree-mainline: d4c734cdbd
git-subtree-split: 6c478c54d0
This commit is contained in:
Paul Spenke
2023-06-13 07:27:11 +08:00
151 changed files with 46689 additions and 0 deletions
+93
View File
@@ -0,0 +1,93 @@
<?php
namespace Plugi\Contracts;
interface PageContract
{
/**
* Set the data stored for this page.
*
* @param array|null $data
* @param bool $fullOverwrite whether to fully overwrite or extend existing data
*/
public function setData($data, $fullOverwrite = true);
/**
* Set the translation data of this page.
*
* @param array|null $translationData
*/
public function setTranslations($translationData);
/**
* Return all data stored for this page (page builder data and other data set via setData).
*
* @return array|null
*/
public function getData();
/**
* Return the page builder data stored for this page.
*
* @return array|null
*/
public function getBuilderData();
/**
* Return the id of this page.
*
* @return string
*/
public function getId();
/**
* Return the layout (file name) of this page.
*
* @return string
*/
public function getLayout();
/**
* Return the name of this page.
*
* @return string
*/
public function getName();
/**
* Return the given language dependant setting for this page, in the current or in the given language.
*
* @param string $setting
* @param string|null $locale
* @return mixed|string|null
*/
public function getTranslation(string $setting, $locale = null);
/**
* Return the translated settings of this page.
*
* @return array
*/
public function getTranslations();
/**
* Return the route of this page, in the current or in the given language.
*
* @param string|null $locale
* @return mixed
*/
public function getRoute($locale = null);
/**
* Get the value of the given property of this Page.
*
* @param $property
* @return mixed|null
*/
public function get($property);
/**
* Invalidate all cached variants of this page.
*/
public function invalidateCache();
}