| Current Path : /home/bechata/mp/wp-content/uploads/2022/ejn73c/ |
| Current File : /home/bechata/mp/wp-content/uploads/2022/ejn73c/Models.tar |
Markdown.php 0000666 00000001236 15174775165 0007067 0 ustar 00 <?php
/**
* Class Markdown
*
* @author Terry Lin
* @link https://terryl.in/
*
* @package Githuber
* @since 1.0.0
* @version 1.4.3
*/
namespace Githuber\Model;
class Markdown extends ModelAbstract {
/**
* Constructer.
*
* @return void
*/
public function __construct() {
parent::__construct();
}
/**
* Get the latest post revision.
*
* @param int $post_id The post ID
*
* @return object Post data
*/
function get_lastest_revision( $post_id ) {
return $this->db->get_row(
$this->db->prepare(
"SELECT * FROM {$this->db->posts} WHERE post_type = 'revision' AND post_parent = %d ORDER BY ID DESC",
$post_id
)
);
}
} ModelAbstract.php 0000666 00000001016 15174775165 0010025 0 ustar 00 <?php
/**
* Class ModelAbstract
*
* Models are specifically used for dealing with the data exchange between controller and database.
*
* @author Terry Lin
* @link https://terryl.in/
*
* @package Githuber
* @since 1.0.0
* @version 1.0.0
*/
namespace Githuber\Model;
abstract class ModelAbstract {
/**
* WP DB instance.
*
* @var object
*/
public $db;
/**
* Constructer.
*
* @return void
*/
public function __construct() {
// Get WP DB object.
global $wpdb;
$this->db = &$wpdb;
}
}