mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Models could use load() without primary id
This commit is contained in:
@@ -1453,10 +1453,11 @@ class e_model extends e_object
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic load data from DB
|
* Generic load data from DB
|
||||||
|
* @param mixed $id
|
||||||
* @param boolean $force
|
* @param boolean $force
|
||||||
* @return e_model
|
* @return e_model
|
||||||
*/
|
*/
|
||||||
public function load($id, $force = false)
|
public function load($id = null, $force = false)
|
||||||
{
|
{
|
||||||
if(!$force && $this->getId())
|
if(!$force && $this->getId())
|
||||||
{
|
{
|
||||||
@@ -1468,8 +1469,8 @@ class e_model extends e_object
|
|||||||
$this->setData(array())
|
$this->setData(array())
|
||||||
->_clearCacheData();
|
->_clearCacheData();
|
||||||
}
|
}
|
||||||
$id = e107::getParser()->toDB($id);
|
if($id) $id = e107::getParser()->toDB($id);
|
||||||
if(!$id)
|
if(!$id && !$this->getParam('db_query'))
|
||||||
{
|
{
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user