1<?php
2/**
3 * Created by PhpStorm.
4 * User: ghi
5 * Date: 14.12.17
6 * Time: 09:45
7 */
8
9namespace dokuwiki\plugin\bez\mdl;
10
11class Task_program extends Entity {
12    protected $id, $name, $count, $added_by, $added_date;
13
14    public static function get_columns() {
15        return array('id', 'name', 'count', 'added_by', 'added_date');
16    }
17
18    public function __construct($model) {
19        parent::__construct($model);
20
21        $this->validator->set_rules(array(
22                                        'name' => array(array('length', 100), 'NOT NULL'),
23                                    ));
24
25        if ($this->id === NULL) {
26            $this->added_by = $this->model->user_nick;
27            $this->added_date = date('c');
28        }
29    }
30}