Test Setup Failed
Pull Request — master (#4389)
by Craig
06:09
created

RouteEntity::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Routes.
5
 *
6
 * @copyright Zikula contributors (Zikula)
7
 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
8
 * @author Zikula contributors <[email protected]>.
9
 * @see https://ziku.la
10
 * @version Generated by ModuleStudio 1.4.0 (https://modulestudio.de).
11
 */
12
13
declare(strict_types=1);
14
15
namespace Zikula\RoutesModule\Entity;
16
17
use Zikula\RoutesModule\Entity\Base\AbstractRouteEntity as BaseEntity;
18
use Doctrine\ORM\Mapping as ORM;
19
20
/**
21
 * Entity class that defines the entity structure and behaviours.
22
 *
23
 * This is the concrete entity class for route entities.
24
 * @ORM\Entity(repositoryClass="Zikula\RoutesModule\Entity\Repository\RouteRepository")
25
 * @ORM\Table(name="zikula_routes_route",
26
 *     indexes={
27
 *         @ORM\Index(name="workflowstateindex", columns={"workflowState"})
28
 *     }
29
 * )
30
 */
31
class RouteEntity extends BaseEntity
32
{
33
    /**
34
     * When getting options, the `zkNoBundlePrefix` and `i18n` values must
35
     * be added before returning. These will override any values for same keys
36
     * set in the `options` array.
37
     */
38
    public function getOptions(): array
39
    {
40
        $options = $this->options;
41
        // zkNoBundlePrefix value is the _opposite_ of prependBundlePrefix value
42
        $options['zkNoBundlePrefix'] = !$this->prependBundlePrefix;
43
        $options['i18n'] = $this->translatable;
44
45
        return $options;
46
    }
47
}
48