Completed
Push — master ( a54060...9ea8d0 )
by Magnus
02:10
created

Post   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInformation() 0 5 1
A getAllInformationWhere() 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 Post extends ActiveRecordModel
14
{
15
16
    /**
17
     * @var string $tableName name of the database table.
18
     */
19
    protected $tableName = "Posts";
20
21
    /**
22
     * Columns in the table.
23
     *
24
     * @var integer $id primary key auto incremented.
25
     */
26
    public $id;
27
    public $posttitle;
28
    public $postname;
29
    public $posttext;
30
31 1
    public function getInformation($name)
32
    {
33 1
        $res = $this->find("postname", $name);
34 1
        return $res;
35
    }
36
37
    public function getAllInformationWhere($name)
38
    {
39
        $res = $this->findAllWhere("postname = ?", $name);
40
        return $res;
41
    }
42
}
43