コード例 #1
0
ファイル: ISBN.php プロジェクト: poef/ariadne
 /**
  * _setISBNSubbody
  *
  * Setter for the ISBN Subbody
  *
  * @param string $subbody ISBN Subbody
  *
  * @return void
  *
  * @throws ISBN_Exception in case it fails
  */
 function _setISBNSubbody($subbody)
 {
     /* validate parameter */
     if (is_string($subbody) == false) {
         return new ISBN_Exception('Wrong Vartype');
     }
     $l = strlen($subbody);
     if ($l < 4 || $l > 8) {
         return new ISBN_Exception('Not a Subbody by length');
     }
     /* validate by setting apart */
     $registrant = false;
     $publication = false;
     $groupid = intval($this->isbn_group);
     $r = ISBN::_isbnSubbodyParts($subbody, $groupid, $registrant, $publication);
     if ($r === false) {
         return new ISBN_Exception('Can\'t break');
     }
     /* edit+ setter/getter for Registrant/Publisher and Title/Publication */
     $this->isbn_publisher = $registrant;
     $this->isbn_title = $publication;
 }