|
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\Shopify; |
|
10
|
|
|
|
|
11
|
|
|
/** @mixin Shopify */ |
|
12
|
|
|
trait ManagesOnlineStore |
|
13
|
|
|
{ |
|
14
|
|
|
public function createRedirect(string $path, string $target): ApiResource |
|
15
|
|
|
{ |
|
16
|
|
|
return $this->createResource('redirects', [ |
|
|
|
|
|
|
17
|
|
|
'path' => $path, |
|
18
|
|
|
'target' => $target, |
|
19
|
|
|
]); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
public function getRedirectsCount(array $params = []): int |
|
23
|
|
|
{ |
|
24
|
|
|
return $this->getResourceCount('redirects', $params); |
|
|
|
|
|
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function paginateRedirects(array $params = []): Cursor |
|
28
|
|
|
{ |
|
29
|
|
|
return $this->cursor($this->getOrders($params)); |
|
|
|
|
|
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
public function getRedirects(array $params = []): Collection |
|
33
|
|
|
{ |
|
34
|
|
|
return $this->getResources('redirects', $params); |
|
|
|
|
|
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getRedirect($redirectId): ApiResource |
|
38
|
|
|
{ |
|
39
|
|
|
return $this->getResource('redirects', $redirectId); |
|
|
|
|
|
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function updateRedirect($redirectId, $data): ApiResource |
|
43
|
|
|
{ |
|
44
|
|
|
return $this->updateResource('redirects', $redirectId, $data); |
|
|
|
|
|
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function deleteRedirect($redirectId): void |
|
48
|
|
|
{ |
|
49
|
|
|
$this->deleteResource('redirects', $redirectId); |
|
|
|
|
|
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function createBlog(array $data): BlogResource |
|
53
|
|
|
{ |
|
54
|
|
|
return $this->createResource('blogs', $data); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getBlogsCount(array $params = []): int |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->getResourceCount('blogs', $params); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function paginateBlogs(array $params = []): Cursor |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->cursor($this->getBlogs($params)); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getBlogs(array $params = []): Collection |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->getResources('blogs', $params); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function getBlog($blogId): BlogResource |
|
73
|
|
|
{ |
|
74
|
|
|
return $this->getResource('blogs', $blogId); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function updateBlog($blogId, $data): BlogResource |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->updateResource('blogs', $blogId, $data); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function deleteBlog($blogId): void |
|
83
|
|
|
{ |
|
84
|
|
|
$this->deleteResource('blogs', $blogId); |
|
85
|
|
|
} |
|
86
|
|
|
} |
|
87
|
|
|
|
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.