Code Duplication    Length = 47-52 lines in 3 locations

core/domain/services/graphql/connections/RootQueryDatetimesConnection.php 1 location

@@ 18-64 (lines=47) @@
15
 * @author  Manzoor Ahmad Wani
16
 * @since   $VID:$
17
 */
18
class RootQueryDatetimesConnection extends AbstractRootQueryConnection
19
{
20
21
22
    /**
23
     * DatetimeConnection constructor.
24
     *
25
     * @param EEM_Datetime               $model
26
     */
27
    public function __construct(EEM_Datetime $model)
28
    {
29
        $this->model = $model;
30
    }
31
32
33
    /**
34
     * @return array
35
     * @since $VID:$
36
     */
37
    public function config()
38
    {
39
        return [
40
            'fromType'           => 'RootQuery',
41
            'toType'             => 'Datetime',
42
            'fromFieldName'      => 'datetimes',
43
            'connectionTypeName' => 'RootQueryDatetimesConnection',
44
            'connectionArgs'     => EventDatetimesConnection::get_connection_args(),
45
            'resolve'            => [$this, 'resolveConnection'],
46
            'resolveNode'        => [$this, 'resolveNode']
47
        ];
48
    }
49
50
51
    /**
52
     * @param $entity
53
     * @param $args
54
     * @param $context
55
     * @param $info
56
     * @return DatetimeConnectionResolver
57
     * @throws Exception
58
     * @since $VID:$
59
     */
60
    public function getConnectionResolver($entity, $args, $context, $info)
61
    {
62
        return new DatetimeConnectionResolver($entity, $args, $context, $info);
63
    }
64
}
65

core/domain/services/graphql/connections/RootQueryPricesConnection.php 1 location

@@ 18-69 (lines=52) @@
15
 * @author  Manzoor Ahmad Wani
16
 * @since   $VID:$
17
 */
18
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

core/domain/services/graphql/connections/RootQueryTicketsConnection.php 1 location

@@ 18-69 (lines=52) @@
15
 * @author  Manzoor Ahmad Wani
16
 * @since   $VID:$
17
 */
18
class RootQueryTicketsConnection extends AbstractRootQueryConnection
19
{
20
21
    /**
22
     * @var EEM_Ticket $model
23
     */
24
    protected $model;
25
26
27
    /**
28
     * TicketConnection constructor.
29
     *
30
     * @param EEM_Ticket               $model
31
     */
32
    public function __construct(EEM_Ticket $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'             => 'Ticket',
47
            'fromFieldName'      => 'tickets',
48
            'connectionTypeName' => 'RootQueryTicketsConnection',
49
            'connectionArgs'     => DatetimeTicketsConnection::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 TicketConnectionResolver
62
     * @throws Exception
63
     * @since $VID:$
64
     */
65
    public function getConnectionResolver($entity, $args, $context, $info)
66
    {
67
        return new TicketConnectionResolver($entity, $args, $context, $info);
68
    }
69
}
70