Version 0.9.13
This commit is contained in:
@@ -26,6 +26,42 @@ class PartTable extends Table
|
||||
$this->setColumnAlias('published', 'state');
|
||||
}
|
||||
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set created date if not set.
|
||||
if (!(int) $this->created) {
|
||||
$this->created = Factory::getDate()->toSql();
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->state < 0) {
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
} elseif (empty($this->ordering)) {
|
||||
// Set ordering to last if ordering was 0
|
||||
$this->ordering = self::getNextOrder($this->_db->quoteName('state') . ' >= 0');
|
||||
}
|
||||
|
||||
// Set modified to created if not set
|
||||
if (!$this->modified) {
|
||||
$this->modified = $this->created;
|
||||
}
|
||||
// Set modified_by to created_by if not set
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function store($updateNulls = true)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
|
Reference in New Issue
Block a user