Comment::findAllWhereDouble()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 10
ccs 0
cts 9
cp 0
crap 6
rs 10
1
<?php
2
3
namespace Aiur18\Question;
4
5
use Anax\DatabaseActiveRecord\ActiveRecordModel;
6
7
/**
8
 * A database driven model using the Active Record design pattern.
9
 */
10
class Comment extends ActiveRecordModel
11
{
12
    /** 
13
     * @var string $tableName name of the database table.
14
     */
15
    protected $tableName = "Comment";
16
17
18
19
    /** variable
20
     */
21
    public $id;
22
    public $comment;
23
    public $user_id;
24
25
    /** Method
26
     */
27
    public function findAllWhereDouble($where, $value)
28
    {
29
        $this->checkDb();
30
        $params = is_array($value) ? $value : [$value];
31
        return $this->db->connect()
32
                        ->select()
33
                        ->from($this->tableName)
34
                        ->where($where)
35
                        ->execute($params)
36
                        ->fetchAllClass(get_class($this));
37
    }
38
}
39