/** * Optouts subscribers from inbound table * stores in the memcache for stoping sending * campaign to them from API users * */ public function optoutsListFromInboundToMemcache() { $this->updatePhonenumber(); $mobj = new Application_Model_CacheMemcache(86400); $optin_key_list = "OPTIN_ALL_KEYS"; $get_all_keys = $mobj->getData($optin_key_list); foreach ($get_all_keys as $key13 => $val13) { $mobj->delData($val13); } $mobj->delData($optin_key_list); $optarr = $this->getoptedoutFromInbound(); $optinarrkeys = array(); $sortphone = array(); $cnt = count($optarr); $data_in_array = 15000; foreach ($optarr as $key => $val) { if ($key % $data_in_array == 0) { if ($key != 0) { $optinKeys = $val; $optinarrkeys[] = $optinKeys; $mobj->setData($optinKeys, $sortphone); unset($sortphone); } } if ($key == $cnt - 1 && count($sortphone) < $data_in_array) { $optinKeys = $val; $optinarrkeys[] = $optinKeys; $mobj->setData($optinKeys, $sortphone); unset($sortphone); } $sortphone[$val] = $val; } $mobj->setData($optin_key_list, $optinarrkeys); }