mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Code cleanup
This commit is contained in:
@@ -265,7 +265,7 @@ class e_object
|
|||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @return e_tree_model
|
* @return mixed|e_tree_model
|
||||||
*/
|
*/
|
||||||
public function setParam($key, $value)
|
public function setParam($key, $value)
|
||||||
{
|
{
|
||||||
@@ -590,7 +590,7 @@ class e_model extends e_object
|
|||||||
/**
|
/**
|
||||||
* Optional DB table - used for auto-load data from the DB
|
* Optional DB table - used for auto-load data from the DB
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @return e_model
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getModelTable()
|
public function getModelTable()
|
||||||
{
|
{
|
||||||
@@ -665,10 +665,16 @@ class e_model extends e_object
|
|||||||
|
|
||||||
$eurl = e107::getUrl();
|
$eurl = e107::getUrl();
|
||||||
|
|
||||||
if(empty($options)) $options = array();
|
if (empty($options))
|
||||||
elseif(!is_array($options)) parse_str($options, $options);
|
{
|
||||||
|
$options = array();
|
||||||
|
}
|
||||||
|
elseif(is_string($options))
|
||||||
|
{
|
||||||
|
parse_str($options, $options);
|
||||||
|
}
|
||||||
|
|
||||||
$vars = $this->toArray();
|
$vars = $this->toArray();
|
||||||
if(!isset($options['allow']) || empty($options['allow']))
|
if(!isset($options['allow']) || empty($options['allow']))
|
||||||
{
|
{
|
||||||
if(vartrue($urldata['vars']) && is_array($urldata['vars']))
|
if(vartrue($urldata['vars']) && is_array($urldata['vars']))
|
||||||
@@ -3571,7 +3577,9 @@ class e_tree_model extends e_front_model
|
|||||||
*/
|
*/
|
||||||
protected function countResults($sql)
|
protected function countResults($sql)
|
||||||
{
|
{
|
||||||
$this->_total = is_int($sql->total_results) ? $sql->total_results : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler
|
$total = $sql->foundRows();
|
||||||
|
$this->_total = is_int($total) ? $total : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler
|
||||||
|
|
||||||
if(false === $this->_total && $this->getModelTable() && !$this->getParam('nocount'))
|
if(false === $this->_total && $this->getModelTable() && !$this->getParam('nocount'))
|
||||||
{
|
{
|
||||||
//SQL_CALC_FOUND_ROWS not found in the query, do one more query
|
//SQL_CALC_FOUND_ROWS not found in the query, do one more query
|
||||||
|
Reference in New Issue
Block a user