Allow projects to be archived.

Closes #771
This commit is contained in:
Alex Davyskiba 2015-01-31 11:50:57 +02:00 committed by Dan Cryer
commit 36b39bfc0d
17 changed files with 107 additions and 3 deletions

View file

@ -44,6 +44,7 @@ class ProjectBase extends Model
'build_config' => null,
'ssh_public_key' => null,
'allow_public_status' => null,
'archived' => null,
);
/**
@ -62,6 +63,7 @@ class ProjectBase extends Model
'build_config' => 'getBuildConfig',
'ssh_public_key' => 'getSshPublicKey',
'allow_public_status' => 'getAllowPublicStatus',
'archived' => 'getArchived',
// Foreign key getters:
);
@ -82,6 +84,7 @@ class ProjectBase extends Model
'build_config' => 'setBuildConfig',
'ssh_public_key' => 'setSshPublicKey',
'allow_public_status' => 'setAllowPublicStatus',
'archived' => 'setArchived',
// Foreign key setters:
);
@ -148,6 +151,12 @@ class ProjectBase extends Model
'type' => 'int',
'length' => 11,
),
'archived' => array(
'type' => 'tinyint',
'length' => 4,
'nullable' => true,
'default' => null,
),
);
/**
@ -296,6 +305,18 @@ class ProjectBase extends Model
return $rtn;
}
/**
* Get the value of Archived / archived.
*
* @return int
*/
public function getArchived()
{
$rtn = $this->data['archived'];
return $rtn;
}
/**
* Set the value of Id / id.
*
@ -506,6 +527,24 @@ class ProjectBase extends Model
$this->_setModified('allow_public_status');
}
/**
* Set the value of Archived / archived.
*
* @param $value int
*/
public function setArchived($value)
{
$this->_validateInt('Archived', $value);
if ($this->data['archived'] === $value) {
return;
}
$this->data['archived'] = $value;
$this->_setModified('archived');
}
/**
* Get Build models by ProjectId for this Project.
*