2019-09-25 10:34:38 +02:00
|
|
|
<?php
|
2019-09-10 06:27:33 +02:00
|
|
|
|
2019-09-25 10:34:38 +02:00
|
|
|
class OpalEstate_User_Statistics {
|
|
|
|
public $user_id;
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
$this->user_id = get_current_user_id();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_count_properties() {
|
|
|
|
$query = Opalestate_Query::get_properties_by_user( [], $this->user_id );
|
|
|
|
|
|
|
|
return $query->found_posts;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_count_featured() {
|
|
|
|
$query = Opalestate_Query::get_properties_by_user( [
|
|
|
|
'featured' => 1,
|
|
|
|
], $this->user_id );
|
|
|
|
|
|
|
|
return $query->found_posts;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_count_published_properties() {
|
|
|
|
$query = Opalestate_Query::get_properties_by_user( [
|
|
|
|
'post_status' => 'publish',
|
|
|
|
], $this->user_id );
|
|
|
|
|
|
|
|
return $query->found_posts;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_count_pending_properties() {
|
|
|
|
$query = Opalestate_Query::get_properties_by_user( [
|
|
|
|
'post_status' => 'pending',
|
|
|
|
], $this->user_id );
|
|
|
|
|
|
|
|
return $query->found_posts;
|
2019-09-10 06:27:33 +02:00
|
|
|
}
|
2019-09-25 10:34:38 +02:00
|
|
|
}
|