| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
namespace Tamara\Wp\Plugin\Traits; |
| 5 |
|
| 6 |
use Tamara\Wp\Plugin\Dependencies\Illuminate\Container\Container; |
| 7 |
|
| 8 |
trait ServiceTrait |
| 9 |
{ |
| 10 |
/** |
| 11 |
* @var Container|null |
| 12 |
*/ |
| 13 |
protected $_container = null; |
| 14 |
|
| 15 |
abstract public function init(); |
| 16 |
|
| 17 |
/** |
| 18 |
* @param Container $container |
| 19 |
* |
| 20 |
* @noinspection PhpUnusedDeclarationInspection |
| 21 |
*/ |
| 22 |
public function setContainer(Container $container) |
| 23 |
{ |
| 24 |
if (null === $this->_container) { |
| 25 |
$this->_container = $container; |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* @return Container |
| 31 |
*/ |
| 32 |
public function getContainer(): Container |
| 33 |
{ |
| 34 |
return $this->_container; |
| 35 |
} |
| 36 |
} |
| 37 |
|