| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Core\Files\CSS; |
| 4 |
|
| 5 |
use Elementor\Plugin; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly |
| 9 |
} |
| 10 |
|
| 11 |
abstract class Post_Local_Cache extends Post { |
| 12 |
|
| 13 |
/** |
| 14 |
* Meta cache |
| 15 |
* |
| 16 |
* @var array |
| 17 |
*/ |
| 18 |
private $meta_cache = []; |
| 19 |
|
| 20 |
abstract protected function get_post_id_for_data(); |
| 21 |
|
| 22 |
public function is_update_required() { |
| 23 |
return true; |
| 24 |
} |
| 25 |
|
| 26 |
protected function load_meta() { |
| 27 |
return $this->meta_cache; |
| 28 |
} |
| 29 |
|
| 30 |
protected function delete_meta() { |
| 31 |
$this->meta_cache = []; |
| 32 |
} |
| 33 |
|
| 34 |
protected function update_meta( $meta ) { |
| 35 |
$this->meta_cache = $meta; |
| 36 |
} |
| 37 |
|
| 38 |
protected function get_data() { |
| 39 |
$document = Plugin::$instance->documents->get( $this->get_post_id_for_data() ); |
| 40 |
|
| 41 |
return $document ? $document->get_elements_data() : []; |
| 42 |
} |
| 43 |
} |
| 44 |
|