Passed
Push — master ( 199ece...6bc7da )
by y
02:13
created

Comment::getBlog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Helix\Shopify\Blog\Article;
4
5
use Helix\Shopify\Base\AbstractEntity;
6
use Helix\Shopify\Base\AbstractEntity\CrudTrait;
7
use Helix\Shopify\Blog;
8
use Helix\Shopify\Blog\Article;
9
10
/**
11
 * A blog article comment.
12
 *
13
 * @see https://shopify.dev/docs/admin-api/rest/reference/online-store/comment
14
 *
15
 * @method string   getArticleId    () injected
16
 * @method string   getAuthor       ()
17
 * @method string   getBlogId       () injected
18
 * @method string   getBody         ()
19
 * @method string   getBodyHtml     ()
20
 * @method string   getCreatedAt    ()
21
 * @method string   getEmail        ()
22
 * @method string   getIp           ()
23
 * @method string   getPublishedAt  ()
24
 * @method string   getStatus       ()
25
 * @method string   getUpdatedAt    ()
26
 * @method string   getUserAgent    ()
27
 *
28
 * @method $this    setAuthor       (string $author)
29
 * @method $this    setBody         (string $body)
30
 * @method $this    setBodyHtml     (string $html)
31
 * @method $this    setEmail        (string $email)
32
 * @method $this    setIp           (string $ip)
33
 */
34
class Comment extends AbstractEntity {
35
36
    use CrudTrait;
37
38
    const TYPE = 'comment';
39
    const DIR = 'comments';
40
41
    protected function _container () {
42
        return $this->getArticle();
43
    }
44
45
    protected function _dir (): string {
46
        return 'comments';
47
    }
48
49
    /**
50
     * @return Article
51
     */
52
    public function getArticle () {
53
        return Article::load($this, $this->getArticleId());
54
    }
55
56
    /**
57
     * @return Blog
58
     */
59
    public function getBlog () {
60
        return Blog::load($this, $this->getBlogId());
61
    }
62
}