Passed
Pull Request — master (#48)
by Arman
03:56
created

Query::query()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.6.0
13
 */
14
15
namespace Quantum\Libraries\Database\Idiorm\Statements;
16
17
/**
18
 * Trait Query
19
 * @package Quantum\Libraries\Database\Idiorm\Statements
20
 */
21
trait Query
22
{
23
24
    /**
25
     * @inheritDoc
26
     */
27
    public static function execute(string $query, array $parameters = []): bool
28
    {
29
        return (self::$ormClass)::raw_execute($query, $parameters);
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35
    public static function query(string $query, array $parameters = []): array
36
    {
37
        return (self::$ormClass)::for_table('dummy')->raw_query($query, $parameters)->find_array();
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43
    public static function lastQuery(): ?string
44
    {
45
        return (self::$ormClass)::get_last_query();
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public static function lastStatement(): object
52
    {
53
        return (self::$ormClass)::get_last_statement();
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59
    public static function queryLog(): array
60
    {
61
        return (self::$ormClass)::get_query_log();
62
    }
63
64
}