public function applyDeliveryProfileDynamicAttributes(DeliveryProfileDynamicAttributes $deliveryAttributes)
 {
     $edgeServerIds = explode(',', $this->getEdgeServerIds());
     $deliveryAttributes->setEdgeServerIds($edgeServerIds);
     //Check if there are any edge server that override the delivery profiles
     $edgeServers = EdgeServerPeer::retrieveByPKs($edgeServerIds);
     if (!count($edgeServers)) {
         return false;
     }
     $edgeDeliveryProfilesIds = array();
     foreach ($edgeServers as $edgeServer) {
         if (!$edgeServer->getDeliveryProfileIds()) {
             continue;
         }
         $edgeDeliveryProfilesIds = array_merge($edgeDeliveryProfilesIds, explode(",", $edgeServer->getDeliveryProfileIds()));
     }
     if (count($edgeDeliveryProfilesIds)) {
         $deliveryAttributes->setDeliveryProfileIds($edgeDeliveryProfilesIds, false);
     }
     return true;
 }
Пример #2
0
 public function updateDeliveryAttributes(DeliveryProfileDynamicAttributes $deliveryAttributes)
 {
     $actionList = $this->getActionList(RuleActionType::LIMIT_DELIVERY_PROFILES);
     if ($actionList) {
         // take only the first LIMIT_DELIVERY_PROFILES action
         $action = reset($actionList);
         $deliveryAttributes->setDeliveryProfileIds($action->getDeliveryProfileIds(), $action->getIsBlockedList());
     }
 }
 public function applyDeliveryProfileDynamicAttributes(DeliveryProfileDynamicAttributes $deliveryAttributes)
 {
     $deliveryAttributes->setDeliveryProfileIds($this->deliveryProfileIds, $this->isBlockedList);
     return true;
 }