/**
  * This method finally sends the sms to the number
  * Before this call please verify that the message number or message body
  * are valid, otherwise this method will not send the sms
  * @param $p_num
  */
 function sendSms($p_num)
 {
     $this->recipient = $p_num;
     if ($p_num != null && !empty($p_num) && $this->msgBody != null && !empty($this->msgBody)) {
         $res = file_get_contents($this->_getSmsUrl());
         if (!empty($res)) {
             SmsLogs::createLog($p_num, $res, $this->_parseXML($res) ? SmsLogs::SMS_LOG_CATEGORY_SUCCESS : SmsLogs::SMS_LOG_CATEGORY_FAILURE);
         } else {
             SmsLogs::createLog($p_num, $res, SmsLogs::SMS_LOG_CATEGORY_FAILURE);
         }
     }
 }
 /**
  * Return manager instance
  *
  * @access protected
  * @param void
  * @return AdministrationLogs 
  */
 function manager()
 {
     if (!$this->manager instanceof SmsLogs) {
         $this->manager = SmsLogs::instance();
     }
     return $this->manager;
 }
 /**
  * This function will return paginated result. Result is an array where first element is
  * array of returned object and second populated pagination object that can be used for
  * obtaining and rendering pagination data using various helpers.
  *
  * Items and pagination array vars are indexed with 0 for items and 1 for pagination
  * because you can't use associative indexing with list() construct
  *
  * @access public
  * @param array $arguments Query argumens (@see find()) Limit and offset are ignored!
  * @param integer $items_per_page Number of items per page
  * @param integer $current_page Current page number
  * @return array
  */
 function paginate($arguments = null, $items_per_page = 10, $current_page = 1)
 {
     if (isset($this) && instance_of($this, 'SmsLogs')) {
         return parent::paginate($arguments, $items_per_page, $current_page);
     } else {
         return SmsLogs::instance()->paginate($arguments, $items_per_page, $current_page);
         //$instance =& SmsLogs::instance();
         //return $instance->paginate($arguments, $items_per_page, $current_page);
     }
     // if
 }