ModelRelationsGenerator::getRootNamespace()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Salah3id\Domains\Repository\Generators;
4
5
/**
6
 * Class CriteriaGenerator
7
 * @package Salah3id\Domains\Repository\Generators
8
 * @author Anderson Andrade <[email protected]>
9
 */
10
class ModelRelationsGenerator extends Generator
11
{
12
    /**
13
     * Get stub name.
14
     *
15
     * @var string
16
     */
17
    protected $stub = 'model/relation';
18
19
    /**
20
     * Get root namespace.
21
     *
22
     * @return string
23
     */
24
    public function getRootNamespace()
25
    {
26
        return parent::getRootNamespace() . parent::getConfigGeneratorClassPath($this->getPathConfigNode());
27
    }
28
29
    /**
30
     * Get generator path config node.
31
     * @return string
32
     */
33
    public function getPathConfigNode()
34
    {
35
        return 'relations';
36
    }
37
38
    /**
39
     * Get destination path for generated file.
40
     *
41
     * @return string
42
     */
43
    public function getPath()
44
    {
45
        return $this->getBasePath() . '/' . parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true) . '/' . $this->getName() . 'Relations.php';
46
    }
47
48
    /**
49
     * Get base path of destination file.
50
     *
51
     * @return string
52
     */
53
    public function getBasePath()
54
    {
55
        return $this->domainPath;
56
    }
57
}
58