ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssLacOperationManufacturer.php
Go to the documentation of this file.
1 <?php
2 
3 require_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacAbstractManufacturer.php";
4 
13 {
14 
23  protected static $instance = null;
24 
30  public static function _getInstance()
31  {
32  if (self::$instance == null) {
33  self::$instance = new ilAssLacOperationManufacturer();
34  }
35  return self::$instance;
36  }
37 
46  public function manufacture($attribute)
47  {
48  $operation = "";
49  switch ($attribute) {
51  $operation = new ilAssLacLesserOperation();
52  break;
54  $operation = new ilAssLacLesserOrEqualsOperation();
55  break;
57  $operation = new ilAssLacEqualsOperation();
58  break;
60  $operation = new ilAssLacGreaterOrEqualsOperation();
61  break;
63  $operation = new ilAssLacGreaterOperation();
64  break;
66  $operation = new ilAssLacNotEqualsOperation();
67  break;
69  $operation = new ilAssLacAndOperation();
70  break;
72  $operation = new ilAssLacOrOperation();
73  break;
74  default:
75  throw new ilAssLacUnsupportedOperation($attribute);
76  break;
77  }
78  return $operation;
79  }
80 
100  public function getPattern()
101  {
102  // return '/[&\|<>=]+/';
103  return '/&|\||(?<!<|>)=|<(?!=|>)|>(?!=)|<=|>=|<>/';
104  }
105 
109  private function __construct()
110  {
111  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacLesserOperation.php';
112  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacLesserOrEqualsOperation.php';
113  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacEqualsOperation.php';
114  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacGreaterOrEqualsOperation.php';
115  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacGreaterOperation.php';
116  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacNotEqualsOperation.php';
117  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacAndOperation.php';
118  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacOrOperation.php';
119  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedOperation.php';
120  }
121 
125  private function __clone()
126  {
127  }
128 }
__clone()
Private clone to prevent cloning an object of OperationManufacturer.
manufacture($attribute)
Create a new specific Composite object which is representing the delivered Attribute.
Class OrOperation.
static _getInstance()
Get an Instance of OperationManufacturer.
Class AndOperation.
__construct()
Private construtor to prevent creating an object of OperationManufacturer.
getPattern()
This function create a regular expression to match all operators in a condition.