Example #1
0
 /**
  * Object constructor
  *
  * @param \ZendPdf\InternalType\AbstractTypeObject $val
  * @param integer $objNum
  * @param integer $genNum
  * @param \ZendPdf\ObjectFactory $factory
  * @throws \ZendPdf\Exception\ExceptionInterface
  */
 public function __construct(AbstractTypeObject $val, $objNum, $genNum, ObjectFactory $factory)
 {
     if ($val instanceof self) {
         throw new Exception\RuntimeException('Object number must not be an instance of \\ZendPdf\\InternalType\\IndirectObject.');
     }
     if (!(is_integer($objNum) && $objNum > 0)) {
         throw new Exception\RuntimeException('Object number must be positive integer.');
     }
     if (!(is_integer($genNum) && $genNum >= 0)) {
         throw new Exception\RuntimeException('Generation number must be non-negative integer.');
     }
     $this->_value = $val;
     $this->_objNum = $objNum;
     $this->_genNum = $genNum;
     $this->_factory = $factory;
     $this->setParentObject($this);
     $factory->registerObject($this, $objNum . ' ' . $genNum);
 }