Joywork/import/document/target/BlockPlusFacade.php
2026-05-22 21:21:54 +03:00

38 lines
558 B
PHP

<?php
class BlockPlusFacade implements DocTarget
{
/**
* @car Block
*/
private $block;
public function __construct(Block $block)
{
if (!$block->id) {
throw new \Exception('Wrong model');
}
$this->block = $block;
}
public function getDocTargetType()
{
return Document::TYPE_BLOCK_PLUS;
}
/**
* @return mixed
*/
public function getBlock()
{
return $this->block;
}
/**
* @return integer
*/
public function getDocTargetId()
{
return $this->block->id;
}
}