aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/entities.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index f602297cf..559701406 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -432,6 +432,9 @@
*/
public function import(ODD $data)
{
+ if (!($data instanceof ODDEntity))
+ throw new InvalidParameterException("ElggEntity::import() passed an unexpected ODD class");
+
// Set type and subtype
$this->attributes['type'] = $data->getAttribute('class');
$this->attributes['subtype'] = $data->getAttribute('subclass');