private function filterUniqueValues($values) {
        //Get unique attributes
        $uniqueAttributes = [];
        foreach ($this->configs as $config) {
            if (isset($config['unique']) && $config['unique']) {
                $uniqueAttributes[] = $config['attribute'];
            }
        }

        if (empty($uniqueAttributes)) {
            return $values; //Return all values
        }

        //Filter values per unique attributes
        $uniqueValues = [];
        foreach ($values as $value) {
            $hash = ""; //generate hash per 1+ unique parameters
            foreach ($uniqueAttributes as $ua) {
                $hash .= $value[$ua];
            }
            $uniqueValues[$hash] = $value;
        }
        return $uniqueValues;
    }
private function filterUniqueValues($values) {
        //Get unique attributes
        $uniqueAttributes = [];
        foreach ($this->configs as $config) {
            if (isset($config['unique']) && $config['unique']) {
                $uniqueAttributes[] = $config['attribute'];
            }
        }

        if (empty($uniqueAttributes)) {
            return $values; //Return all values
        }

        //Filter values per unique attributes
        $uniqueValues = [];
        foreach ($values as $value) {
            $hash = ""; //generate hash per 1+ unique parameters
            foreach ($uniqueAttributes as $ua) {
                $hash .= $value[$ua];
            }
            $uniqueValues[$hash] = $value;
        }
        return $uniqueValues;
    }
private function filterUniqueValues ( $ values ) { //Get unique attributes $ uniqueAttributes = [ ] ; foreach ( $ this -> configs as $ config ) { if ( isset ( $ config [ 'unique' ] ) && $ config [ 'unique' ] ) { $ uniqueAttributes [ ] = $ config [ 'attribute' ] ; } } if ( empty ( $ uniqueAttributes ) ) { return $ values ; //Return all values } //Filter values per unique attributes $ uniqueValues = [ ] ; foreach ( $ values as $ value ) { $ hash = "" ; //generate hash per 1+ unique parameters foreach ( $ uniqueAttributes as $ ua ) { $ hash .= $ value [ $ ua ] ; } $ uniqueValues [ $ hash ] = $ value ; } return $ uniqueValues ; }
Will filter values per unique parameters. Config array can receive 1+ unique parameters.
@param array $values
Will filter values per unique parameters . Config array can receive 1 + unique parameters .