20 private $requiredProperties = array(
40 parent::initializeAttributes();
42 $this->attributes[
'subtype'] =
'elgg_upgrade';
45 $this->attributes[
'site_guid'] = 0;
46 $this->attributes[
'container_guid'] = 0;
47 $this->attributes[
'owner_guid'] = 0;
49 $this->is_completed = 0;
59 return $this->is_completed =
true;
68 return (
bool) $this->is_completed;
80 throw new InvalidArgumentException(
'Invalid value for URL path.');
86 throw new InvalidArgumentException(
'Upgrade URL paths must be unique.');
89 $this->upgrade_url =
$path;
112 return $this->completed_time = $time;
121 return $this->completed_time;
131 foreach ($this->requiredProperties as $prop) {
133 throw new UnexpectedValueException(
"ElggUpgrade objects must have a value for the $prop property.");
150 if (array_key_exists(
$name, $this->attributes)) {
165 if (array_key_exists(
$name, $this->attributes)) {
166 return parent::__get(
$name);
188 'subtype' =>
'elgg_upgrade',
189 'private_setting_name' =>
'upgrade_url',
if($guid==elgg_get_logged_in_user_guid()) $name
setPrivateSetting($name, $value)
Adds a private setting to this entity.
getPrivateSetting($name)
Returns a private setting value.
setCompleted()
Mark this upgrade as completed.
initializeAttributes()
Set subtype to upgrade.
getCompletedTime()
Gets the time when the upgrade completed.
save()
Require an upgrade page.
isCompleted()
Has this upgrade completed?
getUpgradeFromPath($path)
Find an ElggUpgrade object by the unique URL path.
setPath($path)
Sets an upgrade URL path.
__set($name, $value)
Set a value as private setting or attribute.
getURL()
Returns a normalized URL for the upgrade page.
__get($name)
Get an attribute or private setting value.
setCompletedTime($time=null)
Sets the timestamp for when the upgrade completed.
elgg river item elgg form comment save
$upgrades
Lists pending upgrades.