From f13f584628abb548f435bc47376012fe8512c4b8 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 23 Jun 2010 17:07:21 +0000 Subject: Added optional 4th argument 'class' for elgg_instanceof(). git-svn-id: http://code.elgg.org/elgg/trunk@6556 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib') 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; } -- cgit v1.2.3