| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Core\Kits\Concerns; |
| 4 |
|
| 5 |
use Elementor\Core\Kits\Documents\Kit; |
| 6 |
use Elementor\Plugin; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
trait Has_Kit_Dependency { |
| 13 |
private ?Kit $kit = null; |
| 14 |
|
| 15 |
public function set_kit( Kit $kit ): self { |
| 16 |
$this->kit = $kit; |
| 17 |
|
| 18 |
return $this; |
| 19 |
} |
| 20 |
|
| 21 |
protected function get_kit(): ?Kit { |
| 22 |
if ( ! $this->kit ) { |
| 23 |
$this->kit = Plugin::$instance->kits_manager->get_active_kit(); |
| 24 |
} |
| 25 |
|
| 26 |
return $this->kit; |
| 27 |
} |
| 28 |
} |
| 29 |
|