expression = $expression; $this->cases = array(); $this->hasDefaultCase = false; if ( $cases !== null ) { $hasDefault = false; foreach ( $cases as $case ) { if ( !$case instanceof ezcTemplateCaseAstNode ) { throw new ezcTemplateInternalException( "Array in case list \$cases must consist of object which are instances of ezcTemplateCaseAstNode, not <" . get_class( $case ) . ">." ); } if ( $case instanceof ezcTemplateDefaultAstNode ) { if ( $hasDefault ) { throw new ezcTemplateInternalException( "The default case is already present as a case entry." ); } $hasDefault = true; } $this->cases[] = $case; } $this->hasDefaultCase = $hasDefault; } } } ?>