/** * Initializes the review system. * * @return void */ protected function initializeReview() { $pageTS = $this->getPageTS(); if (empty($pageTS['review'])) { return; } $this->reviewConfiguration = is_array($pageTS['review']) ? $pageTS['review'] : array(); if (!isset($this->reviewConfiguration['required'])) { $this->reviewConfiguration['required'] = 2; } $this->reviewConfiguration['required'] = max(1, intval($this->reviewConfiguration['required'])); $this->review = $this->reviewRepository->findActive($this->page); if ($this->review === null) { $this->review = $this->objectManager->create('Tx_Contentstage_Domain_Model_Review'); $this->review->setPage($this->page); $this->review->setLevels($this->localRepository->getDepth()); $this->review->setRequired($this->reviewConfiguration['required']); $this->review->setAutoPush(!empty($this->reviewConfiguration['defaultAutoPush'])); } }