예제 #1
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(SmOutgoingPeer::ID, $pks, Criteria::IN);
         $objs = SmOutgoingPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = SmOutgoingPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setSmIncomingId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setOutgoingDate($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setTrxId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setTrxDate($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setMsisdn($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setSms($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setProgram($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setCp($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setSid($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setResponse($arr[$keys[10]]);
     }
 }
예제 #3
0
 public function executeDelete()
 {
     $sm_outgoing = SmOutgoingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($sm_outgoing);
     $ref_error = 0;
     foreach ($sm_outgoing->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $sm_outgoing->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('sm_outgoing/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('sm_outgoing/delete', '_ERR_DELETE_ (' . $sm_outgoing->toString() . ' - id:' . $sm_outgoing->getId() . ')');
     } else {
         $sm_outgoing->delete();
     }
     return $this->forward('sm_outgoing', 'list');
 }
예제 #4
0
 public function countSmOutgoings($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseSmOutgoingPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(SmOutgoingPeer::SM_INCOMING_ID, $this->getId());
     return SmOutgoingPeer::doCount($criteria, $distinct, $con);
 }