// ObjectModel : removed exception thrown if identifier is not set
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9222 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
ca010e3a20
commit
9353d5a8bc
1 file changed
+2
-4
@@ -953,11 +953,9 @@ abstract class ObjectModelCore
|
|||||||
*/
|
*/
|
||||||
public function hydrate(array $data, $id_lang = null)
|
public function hydrate(array $data, $id_lang = null)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($this->identifier, $data))
|
|
||||||
throw new PrestashopException("Identifier '$this->identifier' not found for class '".get_class($this)."'");
|
|
||||||
|
|
||||||
$this->id_lang = $id_lang;
|
$this->id_lang = $id_lang;
|
||||||
$this->id = $data[$this->identifier];
|
if (isset($data[$this->identifier]))
|
||||||
|
$this->id = $data[$this->identifier];
|
||||||
foreach ($data as $key => $value)
|
foreach ($data as $key => $value)
|
||||||
if (array_key_exists($key, $this))
|
if (array_key_exists($key, $this))
|
||||||
$this->$key = $value;
|
$this->$key = $value;
|
||||||
|
|||||||
Reference in new issue
Block a user