ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssLacExpressionManufacturer.php
Go to the documentation of this file.
1<?php
2
27{
36 protected static $instance = null;
37
44 {
45 if (self::$instance == null) {
46 self::$instance = new ilAssLacExpressionManufacturer();
47 }
48 return self::$instance;
49 }
50
58 public function manufacture(string $attribute): ilAssLacAbstractComposite
59 {
60 $expression = null;
61
62 switch (true) {
65 break;
68 break;
69 case preg_match(ilAssLacAnswerOfQuestionExpression::$pattern, $attribute):
70 $expression = new ilAssLacAnswerOfQuestionExpression();
71 break;
72 case preg_match(ilAssLacAnswerOfCurrentQuestionExpression::$pattern, $attribute):
74 break;
75 case preg_match(ilAssLacPercentageResultExpression::$pattern, $attribute):
76 $expression = new ilAssLacPercentageResultExpression();
77 break;
78 case preg_match(ilAssLacNumberOfResultExpression::$pattern, $attribute):
79 $expression = new ilAssLacNumberOfResultExpression();
80 break;
81 case preg_match(ilAssLacNumericResultExpression::$pattern, $attribute):
82 $expression = new ilAssLacNumericResultExpression();
83 break;
84 case preg_match(ilAssLacStringResultExpression::$pattern, $attribute):
85 $expression = new ilAssLacStringResultExpression();
86 break;
87 case preg_match(ilAssLacMatchingResultExpression::$pattern, $attribute):
88 $expression = new ilAssLacMatchingResultExpression();
89 break;
90 case preg_match(ilAssLacOrderingResultExpression::$pattern, $attribute):
91 $expression = new ilAssLacOrderingResultExpression();
92 break;
93 case preg_match(ilAssLacExclusiveResultExpression::$pattern, $attribute):
94 $expression = new ilAssLacExclusiveResultExpression();
95 break;
96 case preg_match(ilAssLacEmptyAnswerExpression::$pattern, $attribute):
97 $expression = new ilAssLacEmptyAnswerExpression();
98 break;
99 default:
100 throw new ilAssLacUnsupportedExpression($attribute);
101 break;
102 }
103
104 $expression->parseValue($attribute);
105 return $expression;
106 }
107
124 public function getPattern(): string
125 {
126 return
127 "/" .
140 "/";
141 }
142
146 private function __clone()
147 {
148 }
149}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPattern()
This function create a regular expression to match all expression in a condition.
static _getInstance()
Get an Instance of ExpressionManufacturer.
__clone()
Private clone to prevent cloning an object of ExpressionManufacturer.
manufacture(string $attribute)
/** Create a new specific Composite object which is representing the delivered Attribute
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...