This repository was archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDocumentFile.php
More file actions
70 lines (64 loc) · 1.73 KB
/
DocumentFile.php
File metadata and controls
70 lines (64 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace tracker\models;
use Yii;
/**
* This is the model class for table "{{%tracker_document_files}}".
*
* @property integer $id
* @property integer $document_id
* @property string $filename
* @property integer $is_show
* @property string $comments
* @property integer $created_at
* @property integer $created_by
* @property Document $document
*/
class DocumentFile extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%tracker_document_files}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['document_id', 'filename', 'created_at', 'created_by'], 'required'],
[['document_id', 'created_at', 'created_by'], 'integer'],
[['is_show'], 'boolean'],
[['comments'], 'string'],
[['filename'], 'string', 'max' => 255],
[
['document_id'],
'exist',
'skipOnError' => true,
'targetClass' => Document::className(),
'targetAttribute' => ['document_id' => 'id'],
],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'filename' => Yii::t('TrackerIssuesModule.views', 'Filename'),
'comments' => Yii::t('TrackerIssuesModule.views', 'Comments'),
'created_at' => Yii::t('TrackerIssuesModule.views', 'Created At'),
'created_by' => Yii::t('TrackerIssuesModule.views', 'Created By'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getDocument()
{
return $this->hasOne(Document::class, ['id' => 'document_id']);
}
}