public function filterData(array $data)
    {
        // Filter the sparse field-set if we have a specific list of properties
        // defined that we want.
        $filterProps = $this->filterProps();
        if (!empty($filterProps)) {
            $filteredData = array_filter($data, function ($key) use ($filterProps) {
                return \in_array($key, $filterProps, true);
            }, ARRAY_FILTER_USE_KEY);

            // We must always have some data after filtering, so if our filtered
            // data is empty, we should just ignore it ...
            if (!empty($filteredData)) {
                $data = $filteredData;
            }
        }

        return $data;
    }
public function filterData(array $data)
    {
        // Filter the sparse field-set if we have a specific list of properties
        // defined that we want.
        $filterProps = $this->filterProps();
        if (!empty($filterProps)) {
            $filteredData = array_filter($data, function ($key) use ($filterProps) {
                return \in_array($key, $filterProps, true);
            }, ARRAY_FILTER_USE_KEY);

            // We must always have some data after filtering, so if our filtered
            // data is empty, we should just ignore it ...
            if (!empty($filteredData)) {
                $data = $filteredData;
            }
        }

        return $data;
    }
public function filterData ( array $ data ) { // Filter the sparse field-set if we have a specific list of properties // defined that we want. $ filterProps = $ this -> filterProps ( ) ; if ( ! empty ( $ filterProps ) ) { $ filteredData = array_filter ( $ data , function ( $ key ) use ( $ filterProps ) { return \ in_array ( $ key , $ filterProps , true ) ; } , ARRAY_FILTER_USE_KEY ) ; // We must always have some data after filtering, so if our filtered // data is empty, we should just ignore it ... if ( ! empty ( $ filteredData ) ) { $ data = $ filteredData ; } } return $ data ; }
Apply the scope's sparse field-set to the given data.

@param array $data

@return array
Apply the scope s sparse field - set to the given data .