Rows=[]; foreach($this->Options->Rows as $currentRow) { $this->Rows[]=new RowRenderer($currentRow,$this); } } public function GetUniqueId(){ return 'Section_'.$this->Options->Id; } public function IsEmpty(){ foreach($this->Rows as $currentRow) if(!$currentRow->IsEmpty()) return false; return true; } /** * Evaluates whether this section should be rendered based on its condition. * @return bool */ public function ShouldRender(){ if($this->Options->Condition==null) return true; $retriever=$this->GetEmailRenderer()->OrderRetriever; if($retriever==null) return true; $manager=new ConditionManager($retriever); $conditionResult=$manager->ShouldProcess($this->Options->Condition); if($this->Options->ConditionAction=='Hide') return !$conditionResult; return $conditionResult; } protected function GetTemplateName() { return 'TwigManager/Renderers/SectionRenderer.twig'; } protected function InternalInitialize() { foreach ($this->Rows as $row) $row->Initialize(); } public function GetChildren() { return $this->Rows; } }