Completed
Branch EDTR/master (872e60)
by
unknown
27:04 queued 17:58
created

RootQueryPricesConnection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\domain\services\graphql\connections;
4
5
use EEM_Price;
6
use EventEspresso\core\domain\services\graphql\connection_resolvers\PriceConnectionResolver;
7
use EventEspresso\core\domain\services\graphql\abstracts\AbstractRootQueryConnection;
8
use Exception;
9
10
/**
11
 * Class RootQueryPricesConnection
12
 * Description
13
 *
14
 * @package EventEspresso\core\domain\services\graphql\connections
15
 * @author  Manzoor Ahmad Wani
16
 * @since   $VID:$
17
 */
18 View Code Duplication
class RootQueryPricesConnection extends AbstractRootQueryConnection
19
{
20
21
    /**
22
     * @var EEM_Price $model
23
     */
24
    protected $model;
25
26
27
    /**
28
     * PriceConnection constructor.
29
     *
30
     * @param EEM_Price               $model
31
     */
32
    public function __construct(EEM_Price $model)
33
    {
34
        $this->model = $model;
35
    }
36
37
38
    /**
39
     * @return array
40
     * @since $VID:$
41
     */
42
    public function config()
43
    {
44
        return [
45
            'fromType'           => 'RootQuery',
46
            'toType'             => 'Price',
47
            'fromFieldName'      => 'prices',
48
            'connectionTypeName' => 'RootQueryPricesConnection',
49
            'connectionArgs'     => TicketPricesConnection::get_connection_args(),
50
            'resolve'            => [$this, 'resolveConnection'],
51
            'resolveNode'        => [$this, 'resolveNode']
52
        ];
53
    }
54
55
56
    /**
57
     * @param $entity
58
     * @param $args
59
     * @param $context
60
     * @param $info
61
     * @return PriceConnectionResolver
62
     * @throws Exception
63
     * @since $VID:$
64
     */
65
    public function getConnectionResolver($entity, $args, $context, $info)
66
    {
67
        return new PriceConnectionResolver($entity, $args, $context, $info);
68
    }
69
}
70