Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
75.00% |
3 / 4 |
CRAP | |
83.33% |
5 / 6 |
TaskListSettings | |
0.00% |
0 / 1 |
|
75.00% |
3 / 4 |
5.12 | |
83.33% |
5 / 6 |
tableName | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
rules | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
attributeLabels | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
init | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
<?php | |
/** | |
* @link https://www.humhub.org/ | |
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG | |
* @license https://www.humhub.com/licences | |
* | |
*/ | |
namespace humhub\modules\tasks\models\lists; | |
use humhub\modules\content\models\ContentTagAddition; | |
use Yii; | |
/** | |
* @property integer $id | |
* @property integer $sort_order | |
* @property integer $tag_id | |
* @property integer $hide_if_completed | |
*/ | |
class TaskListSettings extends ContentTagAddition | |
{ | |
/** | |
* @return string the associated database table name | |
*/ | |
public static function tableName() | |
{ | |
return 'task_list_setting'; | |
} | |
public function rules() | |
{ | |
return [ | |
[['hide_if_completed'], 'safe'] | |
]; | |
} | |
public function attributeLabels() | |
{ | |
return [ | |
'hide_if_completed' => Yii::t('TasksModule.base', 'Hide this list once all tasks are completed') | |
]; | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function init() | |
{ | |
if($this->hide_if_completed === null) { | |
$this->hide_if_completed = 1; | |
} | |
} | |
} |