ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
22  protected static $instance = null;
23 
29  public static function _getInstance(){
30  if(self::$instance == null){
31  self::$instance = new ilAssLacOperationManufacturer();
32  }
33  return self::$instance;
34  }
35 
44  public function manufacture($attribute)
45  {
46  $operation = "";
47  switch($attribute)
48  {
50  $operation = new ilAssLacLesserOperation();
51  break;
53  $operation = new ilAssLacLesserOrEqualsOperation();
54  break;
56  $operation = new ilAssLacEqualsOperation();
57  break;
59  $operation = new ilAssLacGreaterOrEqualsOperation();
60  break;
62  $operation = new ilAssLacGreaterOperation();
63  break;
65  $operation = new ilAssLacNotEqualsOperation();
66  break;
68  $operation = new ilAssLacAndOperation();
69  break;
71  $operation = new ilAssLacOrOperation();
72  break;
73  default:
74  throw new ilAssLacUnsupportedOperation($attribute);
75  break;
76  }
77  return $operation;
78  }
79 
99  public function getPattern()
100  {
101 // return '/[&\|<>=]+/';
102  return '/&|\||(?<!<|>)=|<(?!=|>)|>(?!=)|<=|>=|<>/';
103  }
104 
108  private function __construct()
109  {
110  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacLesserOperation.php';
111  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacLesserOrEqualsOperation.php';
112  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacEqualsOperation.php';
113  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacGreaterOrEqualsOperation.php';
114  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacGreaterOperation.php';
115  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacNotEqualsOperation.php';
116  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacAndOperation.php';
117  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Operations/ilAssLacOrOperation.php';
118  require_once 'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedOperation.php';
119  }
120 
124  private function __clone() {}
125 }
__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.