1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Signifly\Shopify\REST\Actions; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\Collection; |
6
|
|
|
use Signifly\Shopify\REST\Cursor; |
7
|
|
|
use Signifly\Shopify\REST\Resources\ApiResource; |
8
|
|
|
use Signifly\Shopify\REST\Resources\BlogResource; |
9
|
|
|
use Signifly\Shopify\REST\Resources\PageResource; |
10
|
|
|
use Signifly\Shopify\Shopify; |
11
|
|
|
|
12
|
|
|
/** @mixin Shopify */ |
13
|
|
|
trait ManagesOnlineStore |
14
|
|
|
{ |
15
|
|
|
public function createRedirect(string $path, string $target): ApiResource |
16
|
|
|
{ |
17
|
|
|
return $this->createResource('redirects', [ |
|
|
|
|
18
|
|
|
'path' => $path, |
19
|
|
|
'target' => $target, |
20
|
|
|
]); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function getRedirectsCount(array $params = []): int |
24
|
|
|
{ |
25
|
|
|
return $this->getResourceCount('redirects', $params); |
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function paginateRedirects(array $params = []): Cursor |
29
|
|
|
{ |
30
|
|
|
return $this->cursor($this->getRedirects($params)); |
|
|
|
|
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function getRedirects(array $params = []): Collection |
34
|
|
|
{ |
35
|
|
|
return $this->getResources('redirects', $params); |
|
|
|
|
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function getRedirect($redirectId): ApiResource |
39
|
|
|
{ |
40
|
|
|
return $this->getResource('redirects', $redirectId); |
|
|
|
|
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function updateRedirect($redirectId, $data): ApiResource |
44
|
|
|
{ |
45
|
|
|
return $this->updateResource('redirects', $redirectId, $data); |
|
|
|
|
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function deleteRedirect($redirectId): void |
49
|
|
|
{ |
50
|
|
|
$this->deleteResource('redirects', $redirectId); |
|
|
|
|
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function createBlog(array $data): BlogResource |
54
|
|
|
{ |
55
|
|
|
return $this->createResource('blogs', $data); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function getBlogsCount(array $params = []): int |
59
|
|
|
{ |
60
|
|
|
return $this->getResourceCount('blogs', $params); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function paginateBlogs(array $params = []): Cursor |
64
|
|
|
{ |
65
|
|
|
return $this->cursor($this->getBlogs($params)); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function getBlogs(array $params = []): Collection |
69
|
|
|
{ |
70
|
|
|
return $this->getResources('blogs', $params); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function getBlog($blogId): BlogResource |
74
|
|
|
{ |
75
|
|
|
return $this->getResource('blogs', $blogId); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function updateBlog($blogId, $data): BlogResource |
79
|
|
|
{ |
80
|
|
|
return $this->updateResource('blogs', $blogId, $data); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function deleteBlog($blogId): void |
84
|
|
|
{ |
85
|
|
|
$this->deleteResource('blogs', $blogId); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function createPage(array $data): PageResource |
89
|
|
|
{ |
90
|
|
|
return $this->createResource('pages', $data); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
public function getPagesCount(array $params = []): int |
94
|
|
|
{ |
95
|
|
|
return $this->getResourceCount('pages', $params); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function paginatePages(array $params = []): Cursor |
99
|
|
|
{ |
100
|
|
|
return $this->cursor($this->getPages($params)); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function getPages(array $params = []): Collection |
104
|
|
|
{ |
105
|
|
|
return $this->getResources('pages', $params); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function getPage($pageId): PageResource |
109
|
|
|
{ |
110
|
|
|
return $this->getResource('pages', $pageId); |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function updatePage($pageId, $data): PageResource |
114
|
|
|
{ |
115
|
|
|
return $this->updateResource('pages', $pageId, $data); |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function deletePage($pageId): void |
119
|
|
|
{ |
120
|
|
|
$this->deleteResource('pages', $pageId); |
121
|
|
|
} |
122
|
|
|
} |
123
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.