protected function purgeArray(array $array = array()) {

        $result = array();
        $keys   = array_keys($array);

        $this->addBasicPurgeFilters();

        if (!empty($keys) && !empty($this->purgeFilters)) {
            foreach ($keys as $key) {
                $allowed = true;

                foreach ($this->purgeFilters as $filter) {
                    $allowed = $filter($key);

                    if (!$allowed) {
                        break;
                    }
                }

                if ($allowed) {
                    $result[$key] = $array[$key];
                }
            }
        }

        return $result;
    }
protected function purgeArray(array $array = array()) {

        $result = array();
        $keys   = array_keys($array);

        $this->addBasicPurgeFilters();

        if (!empty($keys) && !empty($this->purgeFilters)) {
            foreach ($keys as $key) {
                $allowed = true;

                foreach ($this->purgeFilters as $filter) {
                    $allowed = $filter($key);

                    if (!$allowed) {
                        break;
                    }
                }

                if ($allowed) {
                    $result[$key] = $array[$key];
                }
            }
        }

        return $result;
    }
protected function purgeArray ( array $ array = array ( ) ) { $ result = array ( ) ; $ keys = array_keys ( $ array ) ; $ this -> addBasicPurgeFilters ( ) ; if ( ! empty ( $ keys ) && ! empty ( $ this -> purgeFilters ) ) { foreach ( $ keys as $ key ) { $ allowed = true ; foreach ( $ this -> purgeFilters as $ filter ) { $ allowed = $ filter ( $ key ) ; if ( ! $ allowed ) { break ; } } if ( $ allowed ) { $ result [ $ key ] = $ array [ $ key ] ; } } } return $ result ; }
Removes redundant attributes from model

@param array $array Input array
@return array
Removes redundant attributes from model