Optimize getDataArray

Forum for .PHP developers using the E-conomic API.
Exchange your ideas, tip and tricks using the API.
Best Practices

Optimize getDataArray

Postby lauer » Sat Jun 26, 2010 1:35 am

Hi,

I want to search through my subscriptions and finde the one contain a specific content.
My code looks like this, but it takes from 8-11 seconds to run just the line with GetDataArray.
Code: Select all
   $tname = 'Subscriber';
   $GetAll = $tname.'_GetAll';
   $GetAllResult = $tname.'_GetAllResult';
   $Handle = $tname.'Handle';
   
   $subscriberHandles = $client->$GetAll()->$GetAllResult->$Handle;
   $subscriberDataObjects = $client->Subscriber_GetDataArray(array('entityHandles' => $subscriberHandles))->Subscriber_GetDataArrayResult->SubscriberData;
   foreach ($subscriberDataObjects as $i => $subscriberData) {
      if (strpos($subscriberData->ExtraTextForInvoice, $domain) !== false) {
         return $subscriberData->DebtorHandle->Number;
      }

   }
   return false;

What can I do to optimize this piece of code?

(Currently the array size is 250)
-
lauer
 
Posts: 2
Joined: Wed Oct 07, 2009 4:50 pm

Return to PHP