Example #1
0
 /** set the full postcode
  * @access public
  * @param string $postcode
  * @throws Pas_Geo_Mapit_Exception
  * @return string
  */
 public function setFullPostCode($postcode)
 {
     $validator = new Pas_Validate_ValidPostCode();
     if ($validator->isValid($postcode)) {
         $this->_postcode = str_replace(' ', '', $postcode);
     } else {
         throw new Pas_Geo_Mapit_Exception('Invalid post code specified');
     }
 }
Example #2
0
 /** Validate the postcode
  * @access public
  * @param string $postCode
  * @return boolean
  */
 public function validatePostcode($postCode)
 {
     if ($this->_validator->isValid($postCode)) {
         return true;
     } else {
         return false;
     }
 }