/**
  * Singleton method
  *
  * @param string $context to determine if triggered from install hook
  * @return CRM_Postnummer_Config
  * @access public
  * @static
  */
 public static function singleton($context = null)
 {
     if (!self::$_singleton) {
         self::$_singleton = new CRM_Postnummer_Config($context);
     }
     return self::$_singleton;
 }
 /**
  * Constructor method
  * @param string $uri
  * @param array $mapping
  * @throws CiviCRM_API3_Exception
  * @access public
  */
 public function __construct($uri, $mapping = NULL)
 {
     $this->uri = $uri;
     if ($mapping == NULL) {
         $config = CRM_Postnummer_Config::singleton();
         $mapping = $config->getDefaultMapping();
     }
     $this->mapping = $mapping;
 }
 function buildQuickForm()
 {
     $this->postCode = CRM_Utils_Request::retrieve('pc', 'String');
     $config = CRM_Postnummer_Config::singleton();
     CRM_Utils_System::setTitle("Post Code");
     $this->assign('formHeader', "Edit Post Code" . " " . $this->postCode);
     // add form elements
     $this->add('hidden', 'post_code');
     $this->add('text', 'post_city', 'Post City', array(), true);
     $this->add('text', 'community_number', 'Community Number', array(), true);
     $this->add('text', 'community_name', 'Community Name', array(), true);
     $this->add('text', 'category', 'Category', array('maxlength' => 1, 'size' => 1), true);
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => true)));
     // export form elements
     $this->assign('elementNames', $this->getRenderableElementNames());
     parent::buildQuickForm();
 }