<?php
 class vB_Entity_Channeltask extends vB_Entity { use vB_Trait_NoSerialize; public function __construct( public int $channeltaskid, public int $nodeid, public string $task, public string $maxagefrom, public int $maxageseconds, ) { } public static function createDefault() : static { return new static ( 0, 0, '', '', 30 * 86400 ); } public static function createFromArray(array $dbrecord) : static { return new static ( $dbrecord['channeltaskid'], $dbrecord['nodeid'], $dbrecord['task'], $dbrecord['maxagefrom'], $dbrecord['maxageseconds'], ); } protected function maxagedays($value = null) { if (func_num_args() == 1) { $this->maxageseconds = intval($value * 86400); } else { return $this->maxageseconds / 86400; } } public function getValidTasks() { return [ 'delete', 'close', ]; } public function getValidMaxAgeFrom() { return [ 'activity', 'created', ]; } } 