public static function filterListData($objectData, $filters = array())
    {
        $result = array();
        foreach ($objectData as $fieldData) {
            $filteredItems = array();
            //====================================================================//
            // Ensure Item is An Array of Fields
            if (!is_array($fieldData) && !($fieldData instanceof ArrayObject)) {
                continue;
            }
            //====================================================================//
            // Convert ArrayObjects to Array
            if ($fieldData instanceof ArrayObject) {
                $fieldData = $fieldData->getArrayCopy();
            }
            //====================================================================//
            // Search for Field in Item Block
            foreach ($filters as $fieldId) {
                if (array_key_exists($fieldId, $fieldData)) {
                    $filteredItems[$fieldId] = $fieldData[$fieldId];
                }
            }
            $result[] = $filteredItems;
        }

        return $result;
    }
public static function filterListData($objectData, $filters = array())
    {
        $result = array();
        foreach ($objectData as $fieldData) {
            $filteredItems = array();
            //====================================================================//
            // Ensure Item is An Array of Fields
            if (!is_array($fieldData) && !($fieldData instanceof ArrayObject)) {
                continue;
            }
            //====================================================================//
            // Convert ArrayObjects to Array
            if ($fieldData instanceof ArrayObject) {
                $fieldData = $fieldData->getArrayCopy();
            }
            //====================================================================//
            // Search for Field in Item Block
            foreach ($filters as $fieldId) {
                if (array_key_exists($fieldId, $fieldData)) {
                    $filteredItems[$fieldId] = $fieldData[$fieldId];
                }
            }
            $result[] = $filteredItems;
        }

        return $result;
    }
public static function filterListData ( $ objectData , $ filters = array ( ) ) { $ result = array ( ) ; foreach ( $ objectData as $ fieldData ) { $ filteredItems = array ( ) ; //====================================================================// // Ensure Item is An Array of Fields if ( ! is_array ( $ fieldData ) && ! ( $ fieldData instanceof ArrayObject ) ) { continue ; } //====================================================================// // Convert ArrayObjects to Array if ( $ fieldData instanceof ArrayObject ) { $ fieldData = $ fieldData -> getArrayCopy ( ) ; } //====================================================================// // Search for Field in Item Block foreach ( $ filters as $ fieldId ) { if ( array_key_exists ( $ fieldId , $ fieldData ) ) { $ filteredItems [ $ fieldId ] = $ fieldData [ $ fieldId ] ; } } $ result [ ] = $ filteredItems ; } return $ result ; }
Filter a Object List Data Block to keap only given Fields

@param array $objectData Object Data Block
@param array $filters    Array of Fields Ids

@return array
Filter a Object List Data Block to keap only given Fields