public function distinct()
    {
        $container = clone $this;
        $newDataPlaceHolder = [];
        
        foreach ($this->getDataPlaceHolder() as $key => $value) {
            
            $found = false;
            
            foreach ($newDataPlaceHolder as $newValue) {
                
                if (gettype($value) === 'object' && $value instanceof Comparable && $value->equals($newValue)) {
                    $found = true;
                    break;
                } elseif (gettype($newValue) === 'object' && $newValue instanceof Comparable && $newValue->equals($value)) {
                    $found = true;
                    break;
                } else if ($value === $newValue) {
                    $found = true;
                    break;
                }
            }
            
            if ($found === false) {
                if (is_string($key) === true) {
                    $newDataPlaceHolder[$key] = $value;
                } else {
                    $newDataPlaceHolder[] = $value;
                }
            }
        }
        
        $container->setDataPlaceHolder($newDataPlaceHolder);
        
        return $container;
    }
public function distinct()
    {
        $container = clone $this;
        $newDataPlaceHolder = [];
        
        foreach ($this->getDataPlaceHolder() as $key => $value) {
            
            $found = false;
            
            foreach ($newDataPlaceHolder as $newValue) {
                
                if (gettype($value) === 'object' && $value instanceof Comparable && $value->equals($newValue)) {
                    $found = true;
                    break;
                } elseif (gettype($newValue) === 'object' && $newValue instanceof Comparable && $newValue->equals($value)) {
                    $found = true;
                    break;
                } else if ($value === $newValue) {
                    $found = true;
                    break;
                }
            }
            
            if ($found === false) {
                if (is_string($key) === true) {
                    $newDataPlaceHolder[$key] = $value;
                } else {
                    $newDataPlaceHolder[] = $value;
                }
            }
        }
        
        $container->setDataPlaceHolder($newDataPlaceHolder);
        
        return $container;
    }
public function distinct ( ) { $ container = clone $ this ; $ newDataPlaceHolder = [ ] ; foreach ( $ this -> getDataPlaceHolder ( ) as $ key => $ value ) { $ found = false ; foreach ( $ newDataPlaceHolder as $ newValue ) { if ( gettype ( $ value ) === 'object' && $ value instanceof Comparable && $ value -> equals ( $ newValue ) ) { $ found = true ; break ; } elseif ( gettype ( $ newValue ) === 'object' && $ newValue instanceof Comparable && $ newValue -> equals ( $ value ) ) { $ found = true ; break ; } else if ( $ value === $ newValue ) { $ found = true ; break ; } } if ( $ found === false ) { if ( is_string ( $ key ) === true ) { $ newDataPlaceHolder [ $ key ] = $ value ; } else { $ newDataPlaceHolder [ ] = $ value ; } } } $ container -> setDataPlaceHolder ( $ newDataPlaceHolder ) ; return $ container ; }
Get Distinct Container Copy.

Provides a copy of the container, with distinct values. In other words,
any duplicated values from the container will not appear in the returned
container.

Please note that the container copy is a shallow copy of the original, not
a deep copy.

@return \qtism\common\collections\Container
Get Distinct Container Copy .