[TASK] Move condition actions to class constants
authorOliver Eglseder <oliver.eglseder@in2code.de>
Thu, 3 Sep 2015 11:46:17 +0000 (13:46 +0200)
committerOliver Eglseder <oliver.eglseder@in2code.de>
Thu, 3 Sep 2015 11:46:17 +0000 (13:46 +0200)
Classes/Domain/Model/Condition.php
Configuration/TCA/tx_powermailcond_domain_model_condition.php

index 5e4ba9d..4879497 100644 (file)
@@ -41,6 +41,16 @@ class Condition extends AbstractEntity {
 
        const CONJUNCTION_OR = 'OR';
        const CONJUNCTION_AND = 'AND';
+       const ACTION_HIDE = 0;
+       const ACTION_UN_HIDE = 1;
+
+       /**
+        * @var array
+        */
+       protected $actionNumberMap = array(
+               self::ACTION_HIDE => 'hide',
+               self::ACTION_UN_HIDE => 'un_hide',
+       );
 
        /**
         * @var \In2code\Powermail\Domain\Repository\FieldRepository
index e661732..d367c8a 100644 (file)
@@ -211,13 +211,13 @@ return array(
                                        // hide
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0',
-                                               '0'
+                                               \In2code\PowermailCond\Domain\Model\Condition::ACTION_HIDE
                                        ),
 
                                        // unhide
                                        array(
                                                'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1',
-                                               '1'
+                                               \In2code\PowermailCond\Domain\Model\Condition::ACTION_UN_HIDE
                                        ),
 
                                        // title additional