openrat-cms

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

PageContext.class.php (908B)


      1 <?php
      2 
      3 
      4 namespace cms\generator;
      5 
      6 
      7 
      8 use cms\generator\link\PreviewLink;
      9 use cms\generator\link\PublicLink;
     10 
     11 /**
     12  * The page context, necessary for generating and publishing a page.
     13  */
     14 class PageContext extends BaseContext
     15 {
     16 
     17 	/**
     18 	 * The source page, links are generated from the view of this page.
     19 	 * @var int
     20 	 */
     21 	public $sourceObjectId;
     22 
     23 	/**
     24 	 * The page which should be generated.
     25 	 * @var int
     26 	 */
     27 	public $objectId;
     28 
     29 	/**
     30 	 * Language.
     31 	 * @var int
     32 	 */
     33 	public $languageId;
     34 
     35 	/**
     36 	 * Model.
     37 	 * @var int
     38 	 */
     39 	public $modelId;
     40 
     41 	public function __construct($objectId, $scheme )
     42 	{
     43 		$this->objectId       = $objectId;
     44 		$this->sourceObjectId = $objectId;
     45 		$this->scheme         = $scheme;
     46 	}
     47 
     48 	public function getCacheKey()
     49 	{
     50 		return [
     51 			$this->objectId,
     52 			$this->languageId,
     53 			$this->modelId,
     54 			$this->scheme
     55 		];
     56 	}
     57 
     58 
     59 	public function getObjectId()
     60 	{
     61 		return $this->sourceObjectId;
     62 	}
     63 }