PostCategory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 30
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 5 1
A getCatName() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 2017-09-27
6
 * Time: 10:27
7
 */
8
9
namespace Radchasay\Comment;
10
11
use \Anax\Database\ActiveRecordModel;
12
13
class PostCategory extends ActiveRecordModel
14
{
15
16
    /**
17
     * @var string $tableName name of the database table.
18
     */
19
    protected $tableName = "PostCategory";
20
21
    /**
22
     * Columns in the table.
23
     *
24
     * @var integer $id primary key auto incremented.
25
     */
26
    public $id;
27
    public $category;
28
29
30
    public function getId($category)
31
    {
32
        $res = $this->find("category", $category);
33
        return $res->id;
34
    }
35
36
37
    public function getCatName($id)
38
    {
39
        $res = $this->find("id", $id);
40
        return $res->category;
41
    }
42
}
43