public function getPermutations(array $sourceDataSet, $subsetSize = null)
    {
        $combinationMap = $this->_combination->getCombinations($sourceDataSet, $subsetSize);
        
        $permutationsMap = [];
        foreach ($combinationMap as $combination) {
            $permutationsMap = array_merge(
                $permutationsMap,
                $this->_findPermutations($combination)
            );
        }
        
        return $permutationsMap;
    }
public function getPermutations(array $sourceDataSet, $subsetSize = null)
    {
        $combinationMap = $this->_combination->getCombinations($sourceDataSet, $subsetSize);
        
        $permutationsMap = [];
        foreach ($combinationMap as $combination) {
            $permutationsMap = array_merge(
                $permutationsMap,
                $this->_findPermutations($combination)
            );
        }
        
        return $permutationsMap;
    }
public function getPermutations ( array $ sourceDataSet , $ subsetSize = null ) { $ combinationMap = $ this -> _combination -> getCombinations ( $ sourceDataSet , $ subsetSize ) ; $ permutationsMap = [ ] ; foreach ( $ combinationMap as $ combination ) { $ permutationsMap = array_merge ( $ permutationsMap , $ this -> _findPermutations ( $ combination ) ) ; } return $ permutationsMap ; }
Creates all the possible permutations for the source data set.

@param array $sourceDataSet The source data from which to calculate permutations.
@param int   $subsetSize    (Optional)<br/>If supplied, only permutations of the indicated
size will be returned.
<p>If the subset size is greater than the source data set size, only permutations for
the wil be calculated for largest SET.</p>
<p>If the subset size is less or equal to 0, only one permutation will be returned with
no elements.</p>
@return array A list of arrays containing all the combinations from the source data set.
Creates all the possible permutations for the source data set .