[TASK] Move rule operations to class constants
authorOliver Eglseder <oliver.eglseder@in2code.de>
Thu, 3 Sep 2015 10:05:33 +0000 (12:05 +0200)
committerOliver Eglseder <oliver.eglseder@in2code.de>
Thu, 3 Sep 2015 10:05:33 +0000 (12:05 +0200)
Classes/Domain/Model/Rule.php
Configuration/TCA/tx_powermailcond_domain_model_rule.php

index aacd90b..a9c925d 100644 (file)
@@ -37,6 +37,17 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
  */
 class Rule extends AbstractEntity {
 
+       const OPERATOR_IS_SET = 0;
+       const OPERATOR_NOT_IS_SET = 1;
+       const OPERATOR_CONTAINS_VALUE = 2;
+       const OPERATOR_NOT_CONTAINS_VALUE = 3;
+       const OPERATOR_IS = 4;
+       const OPERATOR_NOT_IS = 5;
+       const OPERATOR_GREATER_THAN = 6;
+       const OPERATOR_LESS_THAN = 7;
+       const OPERATOR_CONTAINS_VALUE_FROM_FIELD = 8;
+       const OPERATOR_NOT_CONTAINS_VALUE_FROM_FIELD = 9;
+
        /**
         * Internal title
         *
index 6656347..29e9678 100644 (file)
@@ -73,13 +73,13 @@ return array(
                                        // is set
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.0',
-                                               '0'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_IS_SET
                                        ),
 
                                        // is not set
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.1',
-                                               '1'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_NOT_IS_SET
                                        ),
 
                                        // title operatorsComparisonValue
@@ -91,37 +91,37 @@ return array(
                                        // contains
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.2',
-                                               '2'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_CONTAINS_VALUE
                                        ),
 
                                        // contains not
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.3',
-                                               '3'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_NOT_CONTAINS_VALUE
                                        ),
 
                                        // is
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.4',
-                                               '4'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_IS
                                        ),
 
                                        // is not
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.5',
-                                               '5'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_NOT_IS
                                        ),
 
                                        // is greater than
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.6',
-                                               '6'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_GREATER_THAN
                                        ),
 
                                        // is less than
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.7',
-                                               '7'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_LESS_THAN
                                        ),
 
                                        // title operatorsComparisonField
@@ -133,13 +133,13 @@ return array(
                                        // contains value from field
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.8',
-                                               '8'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_CONTAINS_VALUE_FROM_FIELD
                                        ),
 
                                        // contains not value from field
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.9',
-                                               '9'
+                                               \In2code\PowermailCond\Domain\Model\Rule::OPERATOR_NOT_CONTAINS_VALUE_FROM_FIELD
                                        ),
                                ),
                                'size' => 1,
@@ -177,4 +177,4 @@ return array(
                        'displayCond' => 'FIELD:ops:IN:8,9'
                ),
        ),
-);
\ No newline at end of file
+);