ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 108 of file ilAssLacOperationManufacturer.php.

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 }

Member Function Documentation

◆ __clone()

ilAssLacOperationManufacturer::__clone ( )
private

Private clone to prevent cloning an object of OperationManufacturer.

Definition at line 124 of file ilAssLacOperationManufacturer.php.

124{}

◆ _getInstance()

static ilAssLacOperationManufacturer::_getInstance ( )
static

Get an Instance of OperationManufacturer.

Returns
ilAssLacOperationManufacturer

Implements ilAssLacManufacturerInterface.

Definition at line 29 of file ilAssLacOperationManufacturer.php.

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

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 99 of file ilAssLacOperationManufacturer.php.

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

◆ 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 44 of file ilAssLacOperationManufacturer.php.

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 }
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 22 of file ilAssLacOperationManufacturer.php.

Referenced by _getInstance().


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