aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-23 17:07:21 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-23 17:07:21 +0000
commitf13f584628abb548f435bc47376012fe8512c4b8 (patch)
tree5e0948e19d483c80baa0c3c6382ab1b09e1fba2b /engine
parenta8fd46fa6e81f091f73d7d2839f9031ced423f58 (diff)
downloadelgg-f13f584628abb548f435bc47376012fe8512c4b8.tar.gz
elgg-f13f584628abb548f435bc47376012fe8512c4b8.tar.bz2
Added optional 4th argument 'class' for elgg_instanceof().
git-svn-id: http://code.elgg.org/elgg/trunk@6556 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/entities.php7
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;
}