/**
  * Stores a new resumption token record in the database
  * @access private
  * @param string $verb OAI-PMH verb for the request
  * @param string $metadataPrefix Metadata prefix
  * @param int $cursor Offset in response to begin output at
  * @param mixed $set Optional set argument
  * @param string $from Optional from date argument
  * @param string $until Optional until date argument
  * @return OaiPmhRepositoryToken Token model object
  */
 public function createResumptionToken($verb, $metadataPrefix, $cursor, $set, $from, $until)
 {
     $tokenTable = new OaiPmhRepositoryTokenTable();
     $resumptionToken = $tokenTable->createRow();
     $resumptionToken->verb = $verb;
     $resumptionToken->metadata_prefix = $metadataPrefix;
     $resumptionToken->cursor = $cursor + 100;
     if (isset($from)) {
         $resumptionToken->from = $from;
     } else {
         $resumptionToken->from = null;
     }
     if (isset($until)) {
         $resumptionToken->until = $until;
     } else {
         $resumptionToken->until = null;
     }
     if (isset($set)) {
         $resumptionToken->set = $set;
     } else {
         $resumptionToken->set = null;
     }
     $resumptionToken->expiration = self::unixToDb(time() + 60 * 60 * 24);
     $resumptionToken->useragent = $this->_userAgent();
     $resumptionToken->ipaddress = $this->_ipAddress();
     $resumptionToken->save();
     return $resumptionToken;
 }
 /**
  * Stores a new resumption token record in the database
  *
  * @param string $verb OAI-PMH verb for the request
  * @param string $metadataPrefix Metadata prefix
  * @param int $cursor Offset in response to begin output at
  * @param mixed $set Optional set argument
  * @param string $from Optional from date argument
  * @param string $until Optional until date argument
  * @return OaiPmhRepositoryToken Token model object
  */
 private function createResumptionToken($verb, $metadataPrefix, $cursor, $set, $from, $until)
 {
     $tokenTable = new OaiPmhRepositoryTokenTable();
     $resumptionToken = $tokenTable->createRow();
     $resumptionToken->verb = $verb;
     $resumptionToken->metadata_prefix = $metadataPrefix;
     $resumptionToken->cursor = $cursor + 30;
     if (isset($from)) {
         $resumptionToken->from = $from;
     } else {
         $resumptionToken->from = NULL;
     }
     if (isset($until)) {
         $resumptionToken->until = $until;
     } else {
         $resumptionToken->until = NULL;
     }
     if (isset($set)) {
         $resumptionToken->set = $set;
     } else {
         $resumptionToken->set = NULL;
     }
     $resumptionToken->expiration = self::unixToDb(time() + 60 * 60);
     //        $resumptionToken->useragent = $_SERVER('HTTP_USER_AGENT');
     $resumptionToken->ipaddress = Zend_Controller_Front::getInstance()->getRequest()->getClientIp();
     $resumptionToken->save();
     return $resumptionToken;
 }