Added 'user_id' (created by) and 'create_date' columns to 'project_group' table.
This commit is contained in:
parent
4ec6d854c2
commit
7382df7f6d
5 changed files with 131 additions and 20 deletions
|
|
@ -26,24 +26,30 @@ class ProjectGroup extends Model
|
|||
* @var array
|
||||
*/
|
||||
protected $data = [
|
||||
'id' => null,
|
||||
'title' => null,
|
||||
'id' => null,
|
||||
'title' => null,
|
||||
'create_date' => null,
|
||||
'user_id' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $getters = [
|
||||
'id' => 'getId',
|
||||
'title' => 'getTitle',
|
||||
'id' => 'getId',
|
||||
'title' => 'getTitle',
|
||||
'create_date' => 'getCreateDate',
|
||||
'user_id' => 'getUserId',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $setters = [
|
||||
'id' => 'setId',
|
||||
'title' => 'setTitle',
|
||||
'id' => 'setId',
|
||||
'title' => 'setTitle',
|
||||
'create_date' => 'setCreateDate',
|
||||
'user_id' => 'setUserId',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -56,16 +62,6 @@ class ProjectGroup extends Model
|
|||
return $rtn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
$rtn = $this->data['title'];
|
||||
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value int
|
||||
*/
|
||||
|
|
@ -83,6 +79,16 @@ class ProjectGroup extends Model
|
|||
$this->setModified('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
$rtn = $this->data['title'];
|
||||
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value string
|
||||
*/
|
||||
|
|
@ -100,6 +106,63 @@ class ProjectGroup extends Model
|
|||
$this->setModified('title');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreateDate()
|
||||
{
|
||||
$rtn = $this->data['create_date'];
|
||||
|
||||
if (!empty($rtn)) {
|
||||
$rtn = new \DateTime($rtn);
|
||||
}
|
||||
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value \DateTime
|
||||
*/
|
||||
public function setCreateDate($value)
|
||||
{
|
||||
$this->validateDate('create_date', $value);
|
||||
|
||||
if ($this->data['create_date'] === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->data['create_date'] = $value;
|
||||
|
||||
$this->setModified('create_date');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
$rtn = $this->data['user_id'];
|
||||
|
||||
return (integer)$rtn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value integer
|
||||
*/
|
||||
public function setUserId($value)
|
||||
{
|
||||
$this->validateNotNull('user_id', $value);
|
||||
$this->validateInt('user_id', $value);
|
||||
|
||||
if ($this->data['user_id'] === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->data['user_id'] = $value;
|
||||
|
||||
$this->setModified('user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Project models by GroupId for this ProjectGroup.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue