TableTemplate   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
eloc 7
c 2
b 0
f 2
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setTemplateData() 0 11 2
1
<?php
2
3
/**
4
 * @copyright Bluz PHP Team
5
 * @link https://github.com/bluzphp/bluzman
6
 */
7
8
namespace Bluzman\Generator\Template;
9
10
/**
11
 * TableTemplate
12
 *
13
 * @package  Bluzman\Generator\Template
14
 *
15
 * @author   Pavel Machekhin
16
 * @created  2013-04-16 13:35
17
 */
18
19
class TableTemplate extends AbstractTemplate
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $templatePath = 'views/models/table.phtml';
25
26
    /**
27
     * @param array $templateData
28 1
     */
29
    public function setTemplateData(array $templateData)
30
    {
31 1
        // Primary key can be empty in options list
32
        $primaryKey = '';
33 1
34 1
        if (!empty($templateData['primaryKey'])) {
35
            $primaryKey = '\'' . implode('\',\'', $templateData['primaryKey']) . '\'';
36
        }
37 1
38 1
        $templateData['primaryKey'] = $primaryKey;
39 1
        $this->templateData = $templateData;
40
    }
41
}
42