| 1 |
<?php |
| 2 |
namespace Elementor\Core\App\Modules\KitLibrary\Data; |
| 3 |
|
| 4 |
use Elementor\Plugin; |
| 5 |
use Elementor\Data\Base\Controller; |
| 6 |
use Elementor\Modules\Library\User_Favorites; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
abstract class Base_Controller extends Controller { |
| 13 |
/** |
| 14 |
* @var Repository |
| 15 |
*/ |
| 16 |
private $repository; |
| 17 |
|
| 18 |
/** |
| 19 |
* @return Repository |
| 20 |
*/ |
| 21 |
public function get_repository() { |
| 22 |
if ( ! $this->repository ) { |
| 23 |
$this->repository = new Repository( |
| 24 |
Plugin::$instance->common->get_component( 'connect' )->get_app( 'kit-library' ), |
| 25 |
new User_Favorites( get_current_user_id() ) |
| 26 |
); |
| 27 |
} |
| 28 |
|
| 29 |
return $this->repository; |
| 30 |
} |
| 31 |
} |
| 32 |
|