ListObjectsListener   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 34
rs 10
c 1
b 1
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B registerObjects() 0 26 1
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
9
namespace Newscoop\PaywallBundle\EventListener;
10
11
use Newscoop\EventDispatcher\Events\CollectObjectsDataEvent;
12
13
class ListObjectsListener
14
{
15
    /**
16
     * Register plugin list objects in Newscoop.
17
     *
18
     * @param CollectObjectsDataEvent $event
19
     */
20
    public function registerObjects(CollectObjectsDataEvent $event)
21
    {
22
        $event->registerObjectTypes('subscriptions', array(
23
            'class' => '\Newscoop\PaywallBundle\Meta\MetaSubscriptions',
24
        ));
25
26
        $event->registerObjectTypes('subscription', array(
27
            'class' => '\Newscoop\PaywallBundle\Meta\MetaMainSubscription',
28
        ));
29
30
        $event->registerObjectTypes('user_subscription', array(
31
            'class' => '\Newscoop\PaywallBundle\Meta\MetaSubscription',
32
        ));
33
34
        $event->registerListObject('newscoop\paywallbundle\templatelist\price', array(
35
            'class' => 'Newscoop\PaywallBundle\TemplateList\Price',
36
            'list' => 'pricetable',
37
            'url_id' => 'pslid',
38
        ));
39
40
        $event->registerListObject('newscoop\paywallbundle\templatelist\usersubscriptions', array(
41
            'class' => 'Newscoop\PaywallBundle\TemplateList\UserSubscriptions',
42
            'list' => 'usersubscriptions',
43
            'url_id' => 'pusid',
44
        ));
45
    }
46
}
47