Esempio n. 1
0
 private function getInheritedConfig(ARSet $set)
 {
     if ($set->size()) {
         // category level configuration?
         $prod = $set->shift();
         // fill missing product level settings with category level settings
         foreach ($set as $cat) {
             foreach (array('theme', 'isAllVariations', 'isVariationImages', 'listStyle') as $field) {
                 if (!$prod->{$field}->get()) {
                     $prod->{$field}->set($cat->{$field}->get());
                 }
             }
         }
         return $prod;
     }
 }
Esempio n. 2
0
 private function getSelectOptionsFromSet(ARSet $set)
 {
     if (!$set->size()) {
         return array();
     }
     $options = array('' => '');
     foreach ($set as $record) {
         $arr = $record->toArray();
         $options[$record->getID()] = $arr['name_lang'];
     }
     return $options;
 }
Esempio n. 3
0
 private function hasMaskGroupMatch(ARSet $masks, $addressString)
 {
     if (!$masks->size()) {
         return true;
     }
     $match = false;
     foreach ($masks as $mask) {
         if ($this->isMaskMatch($addressString, $mask->mask->get())) {
             $match = 2;
         }
     }
     return $match;
 }