Пример #1
0
 /**
  * Setter for the Registrationgroup Part of the ISBN Number
  *
  * @param string $group Registrationsgroup to set
  *
  * @return void
  *
  * @throws ISBN_Exception in case it fails
  */
 function _setGroup($group)
 {
     if (is_string($group) == false) {
         return new ISBN_Exception('Wrong Vartype');
     }
     $l = strlen($group);
     if ($l < 1 || $l > 5) {
         return new ISBN_Exception('Wrong Group Length (' . $l . ')');
     }
     $testbody = substr($group . '000000000', 0, 9);
     $testgroup = ISBN::_extractGroup($testbody);
     if ($testgroup === false) {
         return new ISBN_Exception('Invalid Group');
     }
     if ($testgroup != $group) {
         return new ISBN_Exception('Invalid Group');
     }
     $this->isbn_group = $group;
 }