aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggSite.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-14 21:25:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-14 21:25:01 -0300
commit3651c99a195685f3a868e159e72c4daf8cb371d3 (patch)
treecb004dd7b6ca55215a2c20112fe0c5209d98c18e /engine/classes/ElggSite.php
parent97e689213ff4e829f251af526ed4e796a3cc2b71 (diff)
parentc2707bb867ddb285af85d7a0e75db26ef692d68c (diff)
downloadelgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.gz
elgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.bz2
Merge branch 'master' into saravea
Conflicts: mod/blog/views/default/blog/sidebar/archives.php
Diffstat (limited to 'engine/classes/ElggSite.php')
-rw-r--r--engine/classes/ElggSite.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 1a34df195..dd996fe98 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -77,28 +77,24 @@ class ElggSite extends ElggEntity {
$msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
throw new IOException($msg);
}
-
- // Is $guid is an ElggSite? Use a copy constructor
} else if ($guid instanceof ElggSite) {
+ // $guid is an ElggSite so this is a copy constructor
elgg_deprecated_notice('This type of usage of the ElggSite constructor was deprecated. Please use the clone method.', 1.7);
foreach ($guid->attributes as $key => $value) {
$this->attributes[$key] = $value;
}
-
- // Is this is an ElggEntity but not an ElggSite = ERROR!
} else if ($guid instanceof ElggEntity) {
+ // @todo remove and just use else clause
throw new InvalidParameterException(elgg_echo('InvalidParameterException:NonElggSite'));
-
- // See if this is a URL
} else if (strpos($guid, "http") !== false) {
+ // url so retrieve by url
$guid = get_site_by_url($guid);
foreach ($guid->attributes as $key => $value) {
$this->attributes[$key] = $value;
}
-
- // Is it a GUID
} else if (is_numeric($guid)) {
+ // $guid is a GUID so load
if (!$this->load($guid)) {
throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
}
@@ -128,7 +124,7 @@ class ElggSite extends ElggEntity {
$this->attributes = $attrs;
$this->attributes['tables_loaded'] = 2;
- cache_entity($this);
+ _elgg_cache_entity($this);
return true;
}