Total Complexity | 7 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class Review |
||
9 | { |
||
10 | public $assigned_to; |
||
11 | public $author; |
||
12 | public $avatar; |
||
13 | public $content; |
||
14 | public $date; |
||
15 | public $email; |
||
16 | public $ID; |
||
17 | public $ip_address; |
||
18 | public $modified; |
||
19 | public $pinned; |
||
20 | public $rating; |
||
21 | public $response; |
||
22 | public $review_id; |
||
23 | public $review_type; |
||
24 | public $status; |
||
25 | public $title; |
||
26 | public $url; |
||
27 | public $user_id; |
||
28 | |||
29 | public function __construct( WP_Post $post ) |
||
30 | { |
||
31 | $this->content = $post->post_content; |
||
32 | $this->date = $post->post_date; |
||
33 | $this->ID = $post->ID; |
||
34 | $this->status = $post->post_status; |
||
35 | $this->title = $post->post_title; |
||
36 | $this->user_id = $post->post_author; |
||
37 | $this->setProperties( $post ); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return bool |
||
42 | */ |
||
43 | protected function isModified( array $properties ) |
||
44 | { |
||
45 | return $this->date != $properties['date'] |
||
46 | || $this->content != $properties['content'] |
||
47 | || $this->title != $properties['title']; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return void |
||
52 | */ |
||
53 | protected function setProperties( WP_Post $post ) |
||
70 | }); |
||
71 | } |
||
72 | } |
||
73 |