31 $this->attributes[
'guid'] = null;
32 $this->attributes[
'type'] =
'site';
33 $this->attributes[
'subtype'] =
'site';
35 $this->attributes[
'owner_guid'] = 0;
36 $this->attributes[
'container_guid'] = 0;
39 $this->attributes[
'time_updated'] = null;
40 $this->attributes[
'last_action'] = null;
41 $this->attributes[
'enabled'] =
"yes";
56 $qb = \Elgg\Database\Select::fromTable(
'entities',
'e');
60 $row = $db->getDataRow($qb);
63 if ($row->guid == $this->attributes[
'guid']) {
65 return parent::save();
68 _elgg_services()->logger->error(
'More than 1 site entity cannot be created.');
72 return parent::save();
85 public function delete($recursive =
true) {
86 if ($this->guid == 1) {
87 throw new \SecurityException(
'You cannot delete the current site');
90 return parent::delete($recursive);
104 public function disable($reason =
"", $recursive =
true) {
105 if ($this->guid == 1) {
106 throw new \SecurityException(
'You cannot disable the current site');
109 return parent::disable($reason, $recursive);
116 if (
$name ===
'url') {
127 if (
$name ===
'url') {
130 return parent::__get(
$name);
153 $object = parent::prepareObject($object);
156 unset($object->read_access);
168 return $breakdown[
'host'];
184 $email =
"noreply-{$token}@{$this->getDomain()}";
getDatabase()
Provides a pointer to the database object.
if(!$item instanceof ElggRiverItem) $object
if(!$user||!$user->canDelete()) $name
elgg parse_url
Parse a URL into its parts.
getEmailAddress()
Get the email address for the site.
$user_guid
Validate a user.
disable($reason="", $recursive=true)
Disable the site.
canComment($user_guid=0, $default=null)
initializeAttributes()
Initialize the attributes array.
prepareObject(\Elgg\Export\Entity $object)
{}
getURL()
Returns the URL for this site.
_elgg_config()
Get the Elgg config service.
$CONFIG url
The full URL where Elgg is installed.
_elgg_services()
Get the global service provider.
if(elgg_view_exists("plugins/{$plugin_id}/settings")) $description
getDomain()
Get the domain for this site.
getDisplayName()
Get the entity's display name.