Added an additional check in event repository for event start date (must be more...
authorjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 27 Sep 2012 13:25:34 +0000 (13:25 +0000)
committerjdegroot <jdegroot@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 27 Sep 2012 13:25:34 +0000 (13:25 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/roq_newsevent/branches/2.0.1.1-externalurls@66399 735d13b6-9817-0410-8766-e36946ffe9aa

Classes/Domain/Repository/EventRepository.php

index b608faa..7453a12 100644 (file)
@@ -139,6 +139,16 @@ class Tx_RoqNewsevent_Domain_Repository_EventRepository extends Tx_News_Domain_R
             $constraints[] = $query->logicalOr($searchConstraints);
         }
 
+            // events only
+        $constraints[] = $query->logicalAnd($query->equals('tx_roqnewsevent_is_event',1));
+
+            // the event must have an event start date
+        $constraints[] = $query->logicalAnd(
+            $query->logicalNot(
+                $query->equals('tx_roqnewsevent_startdate',0)
+            )
+        );
+
             // Clean not used constraints
         foreach($constraints as $key => $value) {
             if (is_null($value)) {
@@ -146,8 +156,6 @@ class Tx_RoqNewsevent_Domain_Repository_EventRepository extends Tx_News_Domain_R
             }
         }
 
-        $constraints[] = $query->logicalAnd($query->equals('tx_roqnewsevent_is_event',1));
-
         return $constraints;
     }
 }