-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
namespace Rougin\Wildfire; | ||
|
||
use CI_Model; | ||
|
||
use Rougin\Wildfire\Traits\ObjectTrait; | ||
use Rougin\Wildfire\Traits\ResultTrait; | ||
use Rougin\Wildfire\Traits\DatabaseTrait; | ||
|
@@ -15,7 +17,7 @@ | |
* @package Wildfire | ||
* @author Rougin Royce Gutib <[email protected]> | ||
*/ | ||
class Wildfire | ||
class Wildfire extends CI_Model | ||
{ | ||
use DatabaseTrait, DescribeTrait, ObjectTrait, ResultTrait; | ||
|
||
|
@@ -37,11 +39,12 @@ public function __construct($database = null, $query = null) | |
* | ||
* @param string $table | ||
* @param array|integer $delimiters | ||
* @param boolean $isForeignKey | ||
* @return object|boolean | ||
*/ | ||
public function find($table, $delimiters = []) | ||
public function find($table, $delimiters = [], $isForeignKey = false) | ||
{ | ||
list($model, $table) = $this->getModel($table); | ||
list($model, $table) = $this->getModel($table, $isForeignKey); | ||
|
||
if ( ! is_array($delimiters)) { | ||
$primaryKey = $this->describe->getPrimaryKey($table); | ||
|
@@ -54,7 +57,7 @@ public function find($table, $delimiters = []) | |
$query = $this->db->get($table); | ||
|
||
if ($query->num_rows() > 0) { | ||
return $this->createObject($table, $query->row()); | ||
return $this->createObject($table, $query->row(), $isForeignKey); | ||
} | ||
|
||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters