PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /home/ngamzghe/cymerion.com/wp-content/plugins/wordpress-seo/src/helpers/ |
| Server: Linux server1.ngambekcore.com 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 04:00:07 EDT 2025 x86_64 IP: 159.198.77.92 |
| Dir : /home/ngamzghe/cymerion.com/wp-content/plugins/wordpress-seo/src/helpers/import-cursor-helper.php |
<?php
namespace Yoast\WP\SEO\Helpers;
/**
* The Import Cursor Helper.
*/
class Import_Cursor_Helper {
/**
* The Options_Helper.
*
* @var Options_Helper
*/
public $options;
/**
* Class constructor.
*
* @param Options_Helper $options The options helper.
*/
public function __construct( Options_Helper $options ) {
$this->options = $options;
}
/**
* Returns the stored cursor value.
*
* @param string $cursor_id The cursor id.
* @param mixed $default_value The default value if no cursor has been set yet.
*
* @return int The stored cursor value.
*/
public function get_cursor( $cursor_id, $default_value = 0 ) {
$import_cursors = $this->options->get( 'import_cursors', [] );
return ( isset( $import_cursors[ $cursor_id ] ) ) ? $import_cursors[ $cursor_id ] : $default_value;
}
/**
* Stores the current cursor value.
*
* @param string $cursor_id The cursor id.
* @param int $last_imported_id The id of the lastly imported entry.
*
* @return void
*/
public function set_cursor( $cursor_id, $last_imported_id ) {
$current_cursors = $this->options->get( 'import_cursors', [] );
if ( ! isset( $current_cursors[ $cursor_id ] ) || $current_cursors[ $cursor_id ] < $last_imported_id ) {
$current_cursors[ $cursor_id ] = $last_imported_id;
$this->options->set( 'import_cursors', $current_cursors );
}
}
}