Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 /** Old bdayclubs info set into
  *  memcache server under createuser key 
  *  @access public
  *   @return void 
  */
 public function addMemcahceBdclub()
 {
     $mobj = new Application_Model_CacheMemcache();
     $sql = "SELECT distinct userid, messagebody FROM bdayclub";
     $rs = $this->query($sql);
     if ($rs->hasResults()) {
         foreach ($rs->fetchAll() as $val) {
             $obj = new stdClass();
             $obj->createuser = $val['userid'];
             $obj->messagebody = $val['messagebody'];
             //                $mobj->delData($val['userid']);
             $mobj->setData($val['userid'], $obj);
         }
         return $rs->fetchAll();
     }
 }