SavedSearch   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCustomers() 0 4 1
1
<?php
2
3
namespace Helix\Shopify\Customer;
4
5
use Helix\Shopify\Base\AbstractEntity;
6
use Helix\Shopify\Base\AbstractEntity\CrudTrait;
7
use Helix\Shopify\Customer;
8
9
/**
10
 * A saved search for customers.
11
 *
12
 * @see https://shopify.dev/docs/admin-api/rest/reference/customers/customersavedsearch
13
 *
14
 * @method string   getCreatedAt    ()
15
 * @method string   getName         ()
16
 * @method string   getQuery        ()
17
 * @method string   getUpdatedAt    ()
18
 *
19
 * @method $this    setName         (string $name)
20
 * @method $this    setQuery        (string $query)
21
 * @todo checked
22
 */
23
class SavedSearch extends AbstractEntity
24
{
25
26
    use CrudTrait;
27
28
    const TYPE = 'customer_saved_search';
29
    const DIR = 'customer_saved_searches';
30
31
    /**
32
     * @param array $query
33
     * @return Customer[]
34
     */
35
    public function getCustomers(array $query)
36
    {
37
        unset($query['fields']);
38
        return Customer::loadAll($this, "{$this}/customers", $query);
39
    }
40
}