ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssLacOperationManufacturer Class Reference

Class OperationManufacturer. More...

+ Inheritance diagram for ilAssLacOperationManufacturer:
+ Collaboration diagram for ilAssLacOperationManufacturer:

Public Member Functions

 manufacture ($attribute)
 Create a new specific Composite object which is representing the delivered Attribute. More...
 
 getPattern ()
 This function create a regular expression to match all operators in a condition. More...
 
- Public Member Functions inherited from ilAssLacAbstractManufacturer
 match ($subject)
 Matches a delivered string with a the pattern returned by getPattern implemented in the explicit Manufacturer. More...
 
 manufacture ($attribute)
 Create a new specific Composite object which is representing the delivered Attribute. More...
 
 getPattern ()
 
 match ($subject)
 Matches a delivered string with a the pattern returned by getPattern implemented in the explicit Manufacturer. More...
 

Static Public Member Functions

static _getInstance ()
 Get an Instance of OperationManufacturer. More...
 
static _getInstance ()
 Get an singleton of the manufacturer. More...
 

Static Protected Attributes

static $instance = null
 

Private Member Functions

 __construct ()
 Private construtor to prevent creating an object of OperationManufacturer. More...
 
 __clone ()
 Private clone to prevent cloning an object of OperationManufacturer. More...
 

Detailed Description

Class OperationManufacturer.

Date: 25.03.13 Time: 15:12

Author
Thomas Joußen tjous.nosp@m.sen@.nosp@m.datab.nosp@m.ay.d.nosp@m.e

Definition at line 12 of file ilAssLacOperationManufacturer.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssLacOperationManufacturer::__construct ( )
private

Private construtor to prevent creating an object of OperationManufacturer.

Definition at line 109 of file ilAssLacOperationManufacturer.php.

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 }

Member Function Documentation

◆ __clone()

ilAssLacOperationManufacturer::__clone ( )
private

Private clone to prevent cloning an object of OperationManufacturer.

Definition at line 125 of file ilAssLacOperationManufacturer.php.

126 {
127 }

◆ _getInstance()

static ilAssLacOperationManufacturer::_getInstance ( )
static

Get an Instance of OperationManufacturer.

Returns
ilAssLacOperationManufacturer

Implements ilAssLacManufacturerInterface.

Definition at line 30 of file ilAssLacOperationManufacturer.php.

31 {
32 if (self::$instance == null) {
33 self::$instance = new ilAssLacOperationManufacturer();
34 }
35 return self::$instance;
36 }

References $instance.

Referenced by ilAssLacConditionParser\cannonicalizeCondition(), ilAssLacCompositeBuilder\create(), and ilAssLacConditionParser\fetchOperators().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacOperationManufacturer::getPattern ( )

This function create a regular expression to match all operators in a condition.


The following string is created by this function '/[!&|<>=]+/'
It matches all operators in a condition and is divided into the following parts:

NEGATION:           !
AND:                &
OR:                 |
LESSER:             <
LESSER OR EQUALS:   <=
EQUALS              =
GREATER OR EQUALS   >=
GREATER             >
NOT EQUALS          <>
Returns
string

Implements ilAssLacManufacturerInterface.

Definition at line 100 of file ilAssLacOperationManufacturer.php.

101 {
102 // return '/[&\|<>=]+/';
103 return '/&|\||(?<!<|>)=|<(?!=|>)|>(?!=)|<=|>=|<>/';
104 }

◆ manufacture()

ilAssLacOperationManufacturer::manufacture (   $attribute)

Create a new specific Composite object which is representing the delivered Attribute.

Parameters
string$attribute
Returns
ilAssLacAbstractComposite|ilAssLacAndOperation|ilAssLacEqualsOperation|ilAssLacGreaterOperation|ilAssLacGreaterOrEqualsOperation|ilAssLacLesserOperation|ilAssLacLesserOrEqualsOperation|ilAssLacNotEqualsOperation|ilAssLacOrOperation
Exceptions
ilAssLacUnsupportedOperation

Implements ilAssLacManufacturerInterface.

Definition at line 46 of file ilAssLacOperationManufacturer.php.

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 }
Class OrOperation.

References ilAssLacAndOperation\$pattern, ilAssLacEqualsOperation\$pattern, ilAssLacGreaterOperation\$pattern, ilAssLacGreaterOrEqualsOperation\$pattern, ilAssLacLesserOperation\$pattern, ilAssLacLesserOrEqualsOperation\$pattern, ilAssLacNotEqualsOperation\$pattern, and ilAssLacOrOperation\$pattern.

Field Documentation

◆ $instance

ilAssLacOperationManufacturer::$instance = null
staticprotected

Definition at line 23 of file ilAssLacOperationManufacturer.php.

Referenced by _getInstance().


The documentation for this class was generated from the following file: