コード例 #1
0
ファイル: Cell.php プロジェクト: zhangxiaoliu/PHPPdf
 public function setParent(Container $node)
 {
     parent::setParent($node);
     foreach ($this->listeners as $listener) {
         $listener->parentBind($this);
     }
 }
コード例 #2
0
ファイル: ContainerTest.php プロジェクト: zhangxiaoliu/PHPPdf
 /**
  * @test
  */
 public function graphicContextIfFetchedFromPage()
 {
     $graphicContextStub = 'some stub';
     $pageMock = $this->getMock('PHPPdf\\Core\\Node\\Page', array('getGraphicsContext'));
     $pageMock->expects($this->once())->method('getGraphicsContext')->will($this->returnValue($graphicContextStub));
     $this->node->setParent($pageMock);
     $this->assertEquals($graphicContextStub, $this->node->getGraphicsContext());
 }
コード例 #3
0
ファイル: Page.php プロジェクト: appotter/phppdf
 public function setWatermark(Container $watermark)
 {
     $watermark->setParent($this);
     $watermark->setAttribute('vertical-align', self::VERTICAL_ALIGN_MIDDLE);
     $watermark->setHeight($this->getHeight());
     $watermark->setWidth($this->getWidth());
     $watermark->setBoundary(clone $this->getBoundary());
     $this->watermark = $watermark;
 }