HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/WritingAssistantKeyword.php.tar
httpdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/WritingAssistantKeyword.php000064400000003047151545241330034703 0ustar00var/www/vhosts/uyarreklam.com.tr<?php
namespace AIOSEO\Plugin\Common\Models;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Keyword.
 *
 * @since 4.7.4
 */
class WritingAssistantKeyword extends Model {
	/**
	 * The name of the table in the database, without the prefix.
	 *
	 * @since 4.7.4
	 *
	 * @var string
	 */
	protected $table = 'aioseo_writing_assistant_keywords';

	/**
	 * Fields that should be numeric values.
	 *
	 * @since 4.7.4
	 *
	 * @var array
	 */
	protected $integerFields = [ 'id', 'progress' ];

	/**
	 * Fields that should be boolean values.
	 *
	 * @since 4.7.4
	 *
	 * @var array
	 */
	protected $booleanFields = [];

	/**
	 * Fields that should be encoded/decoded on save/get.
	 *
	 * @since 4.7.4
	 *
	 * @var array
	 */
	protected $jsonFields = [ 'keywords', 'competitors', 'content_analysis' ];

	/**
	 * Gets a keyword.
	 *
	 * @since 4.7.4
	 *
	 * @param  string $keyword  A keyword.
	 * @param  string $country  The country code.
	 * @param  string $language The language code.
	 * @return object           A keyword found.
	 */
	public static function getKeyword( $keyword, $country, $language ) {
		$dbKeyword = aioseo()->core->db->start( 'aioseo_writing_assistant_keywords' )
			->where( 'keyword', $keyword )
			->where( 'country', $country )
			->where( 'language', $language )
			->run()
			->model( 'AIOSEO\Plugin\Common\Models\WritingAssistantKeyword' );

		if ( ! $dbKeyword->exists() ) {
			$dbKeyword->keyword  = $keyword;
			$dbKeyword->country  = $country;
			$dbKeyword->language = $language;
		}

		return $dbKeyword;
	}
}