public static function updatePendingEntries(&$xml_doc) { $really_pending_entries = array(); list($pending_str, $pending_arr) = myMetadataUtils::getPending($xml_doc); // $entries_in_roughcut = myMetadataUtils::getAllEntries( $xml_doc ); $pending_arr_not_in_roughcut = $pending_arr; //array(); // we should not attemp to match pending entries with the list in the XML - they will never be there // assuming they are really pending /* foreach ( $pending_arr as $pending ) { if ( in_array ( $pending , $entries_in_roughcut ) ) { // we need to keep this entry pending - it's used in the xml $pending_arr_not_in_roughcut[] = $pending; } } */ if (count($pending_arr_not_in_roughcut) > 0) { // get all the enrties that are really pending: $pending = entryPeer::retrievePendingEntries($pending_arr_not_in_roughcut); foreach ($pending as $entry) { $really_pending_entries[] = $entry->getId(); } } myMetadataUtils::setPending($xml_doc, $really_pending_entries); }