Swaps two Elements in List.
@access		protected
@static
@param		array		$list		List
@param		int			$pos1		Position of first Element
@param		int			$pos1		Position of second Element
@return		array
13298
protected static function swap( $list, $pos1, $pos2 )
	{
		$memory	= $list[$pos1];
		$list[$pos1] = $list[$pos2];
		$list[$pos2] = $memory;
		return $list;
	}
295254
protected function sort(SS_List $list)
    {
        switch ($this->owner->SortItemsBy) {
            
            // Random Sort Order:
            
            case self::SORT_RANDOM:
                
                if ($list instanceof DataList) {
                    return $list->sort(DB::get_conn()->random());
                }
                
                $items = $list->toArray();
                
                shuffle($items);
                
                return ArrayList::create($items);
                
            // Default Sort Order:
                
            default:
                
                return $list;
                
        }
    }
364794
public function setItems($list)
    {
        if (!is_array($list)) {
            $this->items = null;

            return;
        }

        $items = [];
        foreach ($list as $index => $element) {
            if ((!is_object($element) || !($element instanceof \ShopgateOrderItem)) && !is_array($element)) {
                unset($list[$index]);
                continue;
            }

            if ($element instanceof \ShopgateOrderItem) {
                $element = $element->toArray();
            }

            $item = $this->itemFactory->create();
            $item->loadArray($element);
            $items[$item->getItemNumber()] = $item;
        }

        $this->items = $items;
    }
318346
public function setPosition( $pos )
	{
		if ( $pos == $this->getPosition() ) { return; }

		$this->_values['pos'] = (int) $pos;
		$this->setModified();
	}
1011578
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setType($value);
                break;
            case 2:
                $this->setName($value);
                break;
            case 3:
                $this->setDomain($value);
                break;
            case 4:
                $this->setApiUrl($value);
                break;
            case 5:
                $this->setApiAuthHttpUser($value);
                break;
            case 6:
                $this->setApiAuthHttpPassword($value);
                break;
            case 7:
                $this->setApiAuthType($value);
                break;
            case 8:
                $this->setApiAuthUser($value);
                break;
            case 9:
                $this->setApiAuthPassword($value);
                break;
            case 10:
                $this->setApiAuthToken($value);
                break;
            case 11:
                $this->setApiAuthUrlUserKey($value);
                break;
            case 12:
                $this->setApiAuthUrlPwKey($value);
                break;
            case 13:
                $this->setCron($value);
                break;
            case 14:
                $this->setCustomerId($value);
                break;
            case 15:
                $this->setActivated($value);
                break;
            case 16:
                $this->setNotes($value);
                break;
            case 17:
                $this->setLastRun($value);
                break;
            case 18:
                $this->setIncludelog($value);
                break;
            case 19:
                $this->setPublicKey($value);
                break;
            case 20:
                $this->setWebsiteHash($value);
                break;
            case 21:
                $this->setNotificationRecipient($value);
                break;
            case 22:
                $this->setNotificationSender($value);
                break;
            case 23:
                $this->setNotificationChange($value);
                break;
            case 24:
                $this->setNotificationError($value);
                break;
        } // switch()
    }
1037453
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSourceId($value);
                break;
            case 2:
                $this->setPageid($value);
                break;
            case 3:
                $this->setTitle($value);
                break;
            case 4:
                $this->setDisplaytitle($value);
                break;
            case 5:
                $this->setPageImageFree($value);
                break;
            case 6:
                $this->setWikibaseItem($value);
                break;
            case 7:
                $this->setDisambiguation($value);
                break;
            case 8:
                $this->setDefaultsort($value);
                break;
            case 9:
                $this->setCreatedAt($value);
                break;
            case 10:
                $this->setUpdatedAt($value);
                break;
        } // switch()

        return $this;
    }
273749
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setLocale($value);
                break;
            case 2:
                $this->setValue($value);
                break;
        } // switch()
    }
465223
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSourceId($value);
                break;
            case 2:
                $this->setPageid($value);
                break;
            case 3:
                $this->setTitle($value);
                break;
            case 4:
                $this->setFiles($value);
                break;
            case 5:
                $this->setSubcats($value);
                break;
            case 6:
                $this->setPages($value);
                break;
            case 7:
                $this->setSize($value);
                break;
            case 8:
                $this->setHidden($value);
                break;
            case 9:
                $this->setCreatedAt($value);
                break;
            case 10:
                $this->setUpdatedAt($value);
                break;
            case 11:
                $this->setTreeLeft($value);
                break;
            case 12:
                $this->setTreeRight($value);
                break;
            case 13:
                $this->setTreeLevel($value);
                break;
        } // switch()

        return $this;
    }
1048255
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setTrackuid($value);
                break;
            case 2:
                $this->setGbxmapname($value);
                break;
            case 3:
                $this->setTrackid($value);
                break;
            case 4:
                $this->setUserid($value);
                break;
            case 5:
                $this->setUsername($value);
                break;
            case 6:
                $this->setUploadedat($value);
                break;
            case 7:
                $this->setUpdatedat($value);
                break;
            case 8:
                $this->setMaptype($value);
                break;
            case 9:
                $this->setTitlepack($value);
                break;
            case 10:
                $this->setStylename($value);
                break;
            case 11:
                $this->setDisplaycost($value);
                break;
            case 12:
                $this->setModname($value);
                break;
            case 13:
                $this->setLightmap($value);
                break;
            case 14:
                $this->setExeversion($value);
                break;
            case 15:
                $this->setExebuild($value);
                break;
            case 16:
                $this->setEnvironmentname($value);
                break;
            case 17:
                $this->setVehiclename($value);
                break;
            case 18:
                $this->setUnlimiterrequired($value);
                break;
            case 19:
                $this->setRoutename($value);
                break;
            case 20:
                $this->setLengthname($value);
                break;
            case 21:
                $this->setLaps($value);
                break;
            case 22:
                $this->setDifficultyname($value);
                break;
            case 23:
                $this->setReplaytypename($value);
                break;
            case 24:
                $this->setReplaywrid($value);
                break;
            case 25:
                $this->setReplaywrtime($value);
                break;
            case 26:
                $this->setReplaywruserid($value);
                break;
            case 27:
                $this->setReplaywrusername($value);
                break;
            case 28:
                $this->setRatingvotecount($value);
                break;
            case 29:
                $this->setRatingvoteaverage($value);
                break;
            case 30:
                $this->setReplaycount($value);
                break;
            case 31:
                $this->setTrackvalue($value);
                break;
            case 32:
                $this->setComments($value);
                break;
            case 33:
                $this->setCommentscount($value);
                break;
            case 34:
                $this->setAwardcount($value);
                break;
            case 35:
                $this->setHasscreenshot($value);
                break;
            case 36:
                $this->setHasthumbnail($value);
                break;
            case 37:
                $this->setHasghostblocks($value);
                break;
            case 38:
                $this->setEmbeddedobjectscount($value);
                break;
        } // switch()

        return $this;
    }
1331156
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setCustomerId($value);
                break;
            case 1:
                $this->setCustomerGroupId($value);
                break;
        } // switch()
    }
79445
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setUsername($value);
                break;
            case 2:
                $this->setPassword($value);
                break;
            case 3:
                $this->setFirstName($value);
                break;
            case 4:
                $this->setLastName($value);
                break;
            case 5:
                $this->setCreateDate($value);
                break;
            case 6:
                $this->setUpdateDate($value);
                break;
            case 7:
                $this->setStatus($value);
                break;
        } // switch()

        return $this;
    }
997332
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSenderlogin($value);
                break;
            case 2:
                $this->setReceiverlogin($value);
                break;
            case 3:
                $this->setTransactionid($value);
                break;
            case 4:
                $this->setBillid($value);
                break;
            case 5:
                $this->setAmount($value);
                break;
            case 6:
                $this->setMessage($value);
                break;
            case 7:
                $this->setStatus($value);
                break;
            case 8:
                $this->setDatetime($value);
                break;
        } // switch()

        return $this;
    }
510858
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setPersonId($value);
                break;
            case 2:
                $this->setFunctionId($value);
                break;
            case 3:
                $this->setCreatedAt($value);
                break;
            case 4:
                $this->setUpdatedAt($value);
                break;
            case 5:
                $this->setVersion($value);
                break;
            case 6:
                $this->setVersionCreatedAt($value);
                break;
            case 7:
                $this->setVersionCreatedBy($value);
                break;
            case 8:
                $this->setPersonIdVersion($value);
                break;
            case 9:
                $this->setFunctionIdVersion($value);
                break;
        } // switch()
    }
1163859
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSlug($value);
                break;
            case 2:
                $this->setHasAttributeAvValue($value);
                break;
            case 3:
                $this->setIsMultilingualAttributeAvValue($value);
                break;
            case 4:
                $this->setPattern($value);
                break;
            case 5:
                $this->setCssClass($value);
                break;
            case 6:
                $this->setInputType($value);
                break;
            case 7:
                $this->setMax($value);
                break;
            case 8:
                $this->setMin($value);
                break;
            case 9:
                $this->setStep($value);
                break;
            case 10:
                $this->setImageMaxWidth($value);
                break;
            case 11:
                $this->setImageMaxHeight($value);
                break;
            case 12:
                $this->setImageRatio($value);
                break;
            case 13:
                $this->setCreatedAt($value);
                break;
            case 14:
                $this->setUpdatedAt($value);
                break;
        } // switch()
    }
756953
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setMediaId($value);
                break;
            case 1:
                $this->setPageId($value);
                break;
        } // switch()

        return $this;
    }
993694
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setUsername($value);
                break;
            case 2:
                $this->setPassword($value);
                break;
            case 3:
                $this->setSalt($value);
                break;
            case 4:
                $this->setFirstname($value);
                break;
            case 5:
                $this->setLastname($value);
                break;
            case 6:
                $this->setEmail($value);
                break;
            case 7:
                $this->setPhone($value);
                break;
            case 8:
                $this->setMemo($value);
                break;
            case 9:
                $this->setActivated($value);
                break;
            case 10:
                $this->setLastLogin($value);
                break;
            case 11:
                $this->setNotificationChange($value);
                break;
            case 12:
                $this->setNotificationError($value);
                break;
        } // switch()
    }
1176118
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setTitle($value);
                break;
            case 2:
                $this->setSlug($value);
                break;
            case 3:
                $this->setFixed($value);
                break;
            case 4:
                $this->setDescription($value);
                break;
            case 5:
                $this->setSportId($value);
                break;
            case 6:
                $this->setSkillCount($value);
                break;
        } // switch()

        return $this;
    }