Skip to content

Commit

Permalink
Merge pull request #61 from nguyenanhung/v3.2.0-develop
Browse files Browse the repository at this point in the history
Fix ORM
  • Loading branch information
nguyenanhung authored Sep 14, 2024
2 parents 1bb1708 + 24953c5 commit c760aa7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion custom/HungNG_CI_Base_Custom_Model_Credentials_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __destruct()
$this->db->close();
log_message(
'info',
'Model "HungNG_CI_Base_Custom_Model_Credentials_model" Class Destructed and database disconnected'
'Model "HungNG_CI_Base_Custom_Model_Credentials_model" destructed and database disconnected successfully!'
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion hungng/HungNG_Custom_Based_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function __destruct()
$this->db->close();
log_message(
'info',
'Class "HungNG_Custom_Based_model" Class Destructed and database disconnected'
'Model "HungNG_Custom_Based_model" destructed and database disconnected successfully!'
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion hungng/HungNG_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function __destruct()
$this->db->close();
log_message(
'info',
'Class "HungNG_Model" Class Destructed and database disconnected'
'Model "HungNG_Model" destructed and database disconnected successfully!'
);
}
}
Expand Down
10 changes: 3 additions & 7 deletions hungng/HungNG_ORM_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function __destruct()
$this->db->close();
log_message(
'info',
'Class "HungNG_ORM_Model" Class Destructed and database disconnected'
'Model "HungNG_ORM_Model" destructed and database disconnected successfully!'
);
}
}
Expand Down Expand Up @@ -579,11 +579,7 @@ public function forceFind()
*/
public static function findOne($condition)
{
if ((isset($this))) {
$instance = $this;
} else {
$instance = new static;
}
$instance = new static;

$record = $instance->_findByCondition($condition)
->limit(1)
Expand Down Expand Up @@ -614,7 +610,7 @@ public static function findOne($condition)
*/
public static function findAll($condition = array(), $limit = null)
{
$instance = (isset($this)) ? $this : new static;
$instance = new static;

$query = $instance->_findByCondition($condition);

Expand Down

0 comments on commit c760aa7

Please sign in to comment.