public static function getAccessionNumber($incrementCounter)
 {
     $setting = QubitSetting::getSettingByName('accession_counter');
     if ($incrementCounter) {
         $setting->value = $setting->getValue(array('sourceCulture' => true)) + 1;
         $setting->save();
         return $setting->getValue(array('sourceCulture' => true));
     }
     return $setting->getValue(array('sourceCulture' => true)) + 1;
 }
 /**
  * Update the OAI Repository settings in database (non-localized)
  */
 protected function updateOaiRepositorySettings()
 {
     $thisForm = $this->oaiRepositoryForm;
     // OAI enabled radio button
     if (null !== ($oaiEnabledValue = $thisForm->getValue('oai_enabled'))) {
         $setting = QubitSetting::getSettingByName('oai_enabled');
         // Force sourceCulture update to prevent discrepency in settings between cultures
         $setting->setValue($oaiEnabledValue, array('sourceCulture' => true));
         $setting->save();
     }
     // OAI repository code
     $oaiRepositoryCodeValue = $thisForm->getValue('oai_repository_code');
     $setting = QubitSetting::getSettingByName('oai_repository_code');
     $setting->setValue($oaiRepositoryCodeValue, array('sourceCulture' => true));
     $setting->save();
     // Hits per page
     if (null !== ($resumptionTokenLimit = $thisForm->getValue('resumption_token_limit'))) {
         if (intval($resumptionTokenLimit) && $resumptionTokenLimit > 0) {
             $setting = QubitSetting::getSettingByName('resumption_token_limit');
             // Force sourceCulture update to prevent discrepency in settings between cultures
             $setting->setValue($resumptionTokenLimit, array('sourceCulture' => true));
             $setting->save();
         }
     }
     return $this;
 }
 /**
  * Get Oai identifier
  * @param
  * @return String containing OAI-compliant Identifier
  */
 public function getOaiIdentifier()
 {
     $domain = sfContext::getInstance()->request->getHost();
     $oaiRepositoryCode = QubitSetting::getSettingByName('oai_repository_code')->getValue(array('sourceCulture' => true));
     $oaiIdentifier = 'oai:' . $domain . ':' . $oaiRepositoryCode . '_' . $this->getOaiLocalIdentifier();
     return $oaiIdentifier;
 }