public function removeDuplicates($values)
    {
        foreach ($values as $key => $option) {
            $value = $this->getCmsPageValue($option);
            if ($value) {
                if ($this->listHasValue($value)) {
                    unset($values[$key]);
                } else {
                    $this->setListValue($value);
                }
            }
        }

        return $values;
    }
public function removeDuplicates($values)
    {
        foreach ($values as $key => $option) {
            $value = $this->getCmsPageValue($option);
            if ($value) {
                if ($this->listHasValue($value)) {
                    unset($values[$key]);
                } else {
                    $this->setListValue($value);
                }
            }
        }

        return $values;
    }
public function removeDuplicates ( $ values ) { foreach ( $ values as $ key => $ option ) { $ value = $ this -> getCmsPageValue ( $ option ) ; if ( $ value ) { if ( $ this -> listHasValue ( $ value ) ) { unset ( $ values [ $ key ] ) ; } else { $ this -> setListValue ( $ value ) ; } } } return $ values ; }
Searches for duplicate CMS pages before saving

@param array $values

@return array
Searches for duplicate CMS pages before saving