with-boxes-trait.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Components\Admin\Vui_Boxes\Traits; |
| 5 | |
| 6 | use JFB_Components\Admin\Vui_Boxes\Boxes_Repository; |
| 7 | |
| 8 | // If this file is called directly, abort. |
| 9 | if ( ! defined( 'WPINC' ) ) { |
| 10 | die; |
| 11 | } |
| 12 | |
| 13 | trait With_Boxes_Trait { |
| 14 | |
| 15 | private $boxes; |
| 16 | |
| 17 | public function boxes(): Boxes_Repository { |
| 18 | if ( ! $this->boxes ) { |
| 19 | $this->boxes = new Boxes_Repository(); |
| 20 | } |
| 21 | |
| 22 | return $this->boxes; |
| 23 | } |
| 24 | |
| 25 | } |
| 26 |