diff options
-rw-r--r-- | engine/lib/entities.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 3b3830948..0f718d162 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -3681,8 +3681,9 @@ function recursive_delete_permissions_check($hook, $entity_type, $returnvalue, $ * @param $type * @param $subtype * @return Bool + * @since 1.8 */ -function elgg_instanceof($entity, $type = NULL, $subtype = NULL) { +function elgg_instanceof($entity, $type = NULL, $subtype = NULL, $class = NULL) { $return = ($entity instanceof ElggEntity); if ($type) { @@ -3692,6 +3693,10 @@ function elgg_instanceof($entity, $type = NULL, $subtype = NULL) { if ($subtype) { $return = $return && ($entity->getSubtype() == $subtype); } + + if ($class) { + $return = $return && ($entity instanceof $class); + } return $return; } |