concrete/src/Gathering/Item/Template/Template.php
public function getGatheringItemTemplateSlotWidth(GatheringItem $item)
    {
        if ($this->getGatheringItemTemplateFixedSlotWidth()) {
            return $this->getGatheringItemTemplateFixedSlotWidth();
        }

        $w = 0;
        $handles = $this->getGatheringItemTemplateFeatureHandles();
        $assignments = \Concrete\Core\Feature\Assignment\GatheringItemAssignment::getList($item);
        foreach ($assignments as $as) {
            if (in_array($as->getFeatureDetailHandle(), $handles)) {
                $fd = $as->getFeatureDetailObject();
                if ($fd->getGatheringItemSuggestedSlotWidth() > 0 && $fd->getGatheringItemSuggestedSlotWidth() > $w) {
                    $w = $fd->getGatheringItemSuggestedSlotWidth();
                }
            }
        }

        if ($w) {
            return $w;
        }

        $wb = $this->getGatheringItemTemplateMinimumSlotWidth($item);
        $wt = $this->getGatheringItemTemplateMaximumSlotWidth($item);

        return mt_rand($wb, $wt);
    }
public function getGatheringItemTemplateSlotWidth(GatheringItem $item)
    {
        if ($this->getGatheringItemTemplateFixedSlotWidth()) {
            return $this->getGatheringItemTemplateFixedSlotWidth();
        }

        $w = 0;
        $handles = $this->getGatheringItemTemplateFeatureHandles();
        $assignments = \Concrete\Core\Feature\Assignment\GatheringItemAssignment::getList($item);
        foreach ($assignments as $as) {
            if (in_array($as->getFeatureDetailHandle(), $handles)) {
                $fd = $as->getFeatureDetailObject();
                if ($fd->getGatheringItemSuggestedSlotWidth() > 0 && $fd->getGatheringItemSuggestedSlotWidth() > $w) {
                    $w = $fd->getGatheringItemSuggestedSlotWidth();
                }
            }
        }

        if ($w) {
            return $w;
        }

        $wb = $this->getGatheringItemTemplateMinimumSlotWidth($item);
        $wt = $this->getGatheringItemTemplateMaximumSlotWidth($item);

        return mt_rand($wb, $wt);
    }
public function getGatheringItemTemplateSlotWidth ( GatheringItem $ item ) { if ( $ this -> getGatheringItemTemplateFixedSlotWidth ( ) ) { return $ this -> getGatheringItemTemplateFixedSlotWidth ( ) ; } $ w = 0 ; $ handles = $ this -> getGatheringItemTemplateFeatureHandles ( ) ; $ assignments = \ Concrete \ Core \ Feature \ Assignment \ GatheringItemAssignment :: getList ( $ item ) ; foreach ( $ assignments as $ as ) { if ( in_array ( $ as -> getFeatureDetailHandle ( ) , $ handles ) ) { $ fd = $ as -> getFeatureDetailObject ( ) ; if ( $ fd -> getGatheringItemSuggestedSlotWidth ( ) > 0 && $ fd -> getGatheringItemSuggestedSlotWidth ( ) > $ w ) { $ w = $ fd -> getGatheringItemSuggestedSlotWidth ( ) ; } } } if ( $ w ) { return $ w ; } $ wb = $ this -> getGatheringItemTemplateMinimumSlotWidth ( $ item ) ; $ wt = $ this -> getGatheringItemTemplateMaximumSlotWidth ( $ item ) ; return mt_rand ( $ wb , $ wt ) ; }
This method is called by GatheringItem when setting defaults.
This method is called by GatheringItem when setting defaults .