Completed
Push — master ( e9e666...e79deb )
by Roni
01:22
created

DoctrineEvents::getConstants()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the XiideaEasyAuditBundle package.
5
 *
6
 * (c) Xiidea <http://www.xiidea.net>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Xiidea\EasyAuditBundle\Events;
13
14
class DoctrineEvents
15
{
16
    private static $prefix = 'easy_audit.doctrine.entity.';
17
18
    const ENTITY_UPDATED = 'easy_audit.doctrine.entity.updated';
19
    const ENTITY_CREATED = 'easy_audit.doctrine.entity.created';
20
    const ENTITY_DELETED = 'easy_audit.doctrine.entity.deleted';
21
22
23
    /**
24
     * @param string $eventName
25
     * @return string
26
     */
27
    public static function getShortEventType($eventName)
28
    {
29
        return str_replace(self::$prefix, '', $eventName);
30
    }
31
32
    /**
33
     * @return array
34
     * @throws \ReflectionException
35
     */
36
    public static function getConstants()
37
    {
38
        $oClass = new \ReflectionClass(__CLASS__);
39
        return $oClass->getConstants();
40
    }
41
}
42