ModelRelationsGenerator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
dl 0
loc 46
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPathConfigNode() 0 3 1
A getPath() 0 3 1
A getBasePath() 0 3 1
A getRootNamespace() 0 3 1
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