Beispiel #1
0
 /**
  * @param CM_Model_ActionLimit_Abstract $actionLimit
  * @param int                           $role
  * @return bool
  */
 private function _isFirstActionLimit(CM_Model_ActionLimit_Abstract $actionLimit, $role)
 {
     $first = true;
     if (null !== $actionLimit->getLimit($role) && 0 !== $actionLimit->getLimit($role)) {
         $period = $actionLimit->getPeriod($role);
         $transgressions = $this->_getTransgressions($actionLimit->getType(), $period);
         if ($transgressions->getCount()) {
             $lastTransgression = $transgressions->getItem(0);
             $actions = $this->_getSiblings($period, $lastTransgression['createStamp']);
             if ($actions->getCount()) {
                 $firstAction = $actions->getItem(-1);
                 if (time() < $firstAction['createStamp'] + $period) {
                     $first = false;
                 }
             }
         }
     }
     return $first;
 }