Passed
Push — 1.0.0-dev ( 4efac2...b68981 )
by nguereza
02:49
created

DatabaseQueryResult::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 2
c 1
b 1
f 1
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
    defined('ROOT_PATH') || exit('Access denied');
3
  /**
4
   * TNH Framework
5
   *
6
   * A simple PHP framework using HMVC architecture
7
   *
8
   * This content is released under the GNU GPL License (GPL)
9
   *
10
   * Copyright (C) 2017 Tony NGUEREZA
11
   *
12
   * This program is free software; you can redistribute it and/or
13
   * modify it under the terms of the GNU General Public License
14
   * as published by the Free Software Foundation; either version 3
15
   * of the License, or (at your option) any later version.
16
   *
17
   * This program is distributed in the hope that it will be useful,
18
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
   * GNU General Public License for more details.
21
   *
22
   * You should have received a copy of the GNU General Public License
23
   * along with this program; if not, write to the Free Software
24
   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
  */
26
  
27
  class DatabaseQueryResult{
28
  	
29
  	/**
30
  	 * The database query result
31
  	 * @var mixed
32
  	 */
33
     private $result  = null;
34
  	
35
    
36
  	/**
37
	 * The number of rows returned by the last query
38
	 * @var int
39
     */
40
     private $numRows = 0;
41
  	
42
	
43
    /**
44
     * Construct new DatabaseQueryResult
45
     * @param mixed $result the query result
46
     * @param int $numRows the number of rows returned by the query
47
     */
48
    public function __construct($result = null, $numRows = 0){
49
        $this->result = $result;
50
        $this->numRows = $numRows;
51
    }
52
53
    
54
     /**
55
     * Return the query result
56
     *
57
     * @return mixed
58
     */
59
    public function getResult(){
60
      return $this->result;
61
    }
62
63
    /**
64
     * Set the query result
65
     * @param mixed $result the query result
66
     *
67
	 * @return object DatabaseQueryResult
68
     */
69
    public function setResult($result){
70
      $this->result = $result;
71
      return $this;
72
    }
73
    
74
    /**
75
     * Return the number of rows returned by the query
76
     *
77
     * @return int
78
     */
79
    public function getNumRows(){
80
      return $this->numRows;
81
    }
82
83
    /**
84
     * Set the number of rows returned by the query
85
     * @param int $numRows the number of rows returned
86
     *
87
	 * @return object DatabaseQueryResult
88
     */
89
    public function setNumRows($numRows){
90
      $this->numRows = $numRows;
91
      return $this;
92
    }
93
   
94
}
95