Joywork/import/document/target/BlockPlusFacade.php

38 lines
558 B
PHP
Raw Normal View History

2026-05-22 20:21:54 +02:00
<?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;
}
}