openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ValueContext.class.php (704B)


      1 <?php
      2 
      3 
      4 namespace cms\generator;
      5 
      6 
      7 /**
      8  * The page context, necessary for generating and publishing a page.
      9  */
     10 class ValueContext extends BaseContext
     11 {
     12 	public $elementid;
     13 
     14 	/**
     15 	 * @var PageContext
     16 	 */
     17 	public $pageContext;
     18 
     19 	/**
     20 	 * @param $pageContext PageContext
     21 	 */
     22 	public function __construct($pageContext )
     23 	{
     24 		$this->pageContext = $pageContext;
     25 		$this->scheme      = $pageContext->scheme;
     26 	}
     27 
     28 	public function getCacheKey()
     29 	{
     30 		return array_merge( ['value'], $this->pageContext->getCacheKey(), [ $this->elementid ] );
     31 	}
     32 
     33 	public function isPublic() {
     34 		return $this->scheme == Producer::SCHEME_PUBLIC;
     35 	}
     36 
     37 	public function getObjectId()
     38 	{
     39 		return $this->pageContext->getObjectId();
     40 	}
     41 }