snapshot_context_get(); } $this->snapshot_id = $snapshot_id; } /** * Update items, that require update. * Ignore if the snapshot is new. * * @param bool $run_from_cron It is running from cron job. * @return bool Was something updated. */ public function maybe_update( $run_from_cron = false ) { // current snapshot <> new & require update. if ( $this->snapshot->get_new_snapshot_id() === $this->snapshot_id || ! $this->require_update() ) { return false; } return $this->update_table( $run_from_cron ); } /** * Does content audit require update? * * @return bool true if current content audit require update. */ public function require_update() { return $this->snapshot->is_require_update( $this->snapshot_id ); } }