Ejemplo n.º 1
0
 public function executeTest()
 {
     $log = SmsLogPeer::doSelect(new Criteria());
     foreach ($log as $l) {
         $jsonwrapper = new jsonwrapper();
         $rc = new Criteria();
         $rc->add(SmsLogRecipientPeer::LOG_ID, $l->getId(), Criteria::EQUAL);
         $recipientCount = SmsLogRecipientPeer::doCount($rc);
         $count = $recipientCount * $l->getSmsLong();
         $l->setSmsCount($count);
         $l->save();
         //$count = ceil(strlen($l->getMessage()) / 140);
         //$l->setSmsCount($count);
         //$l->save();
     }
     die;
 }
Ejemplo n.º 2
0
 public function executeJajal()
 {
     $c = new Criteria();
     $c->add(SmsLogPeer::SMS_LONG, 0, Criteria::EQUAL);
     $data = SmsLogPeer::doSelect($c);
     foreach ($data as $d) {
         $sms_long = ceil(strlen($d->getMessage()) / 160);
         $d->setSmsLong($sms_long);
         $d->save();
     }
     die;
 }
Ejemplo n.º 3
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(SmsLogPeer::ID, $pks, Criteria::IN);
         $objs = SmsLogPeer::doSelect($criteria, $con);
     }
     return $objs;
 }