Completed
Push — develop-3.0 ( 360277...bd5ff0 )
by Mohamed
06:52
created

QueueRelations::changeBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Model\Message;
13
14
use Tinyissue\Model;
15
16
/**
17
 * QueueRelations is trait class containing the relationship methods for the message queue model.
18
 *
19
 * @author Mohamed Alsharaf <[email protected]>
20
 *
21
 * @property static $this
22
 */
23
trait QueueRelations
24
{
25
    /**
26
     * @return Model\User
27
     */
28
    public function changeBy()
29
    {
30
        return $this->belongsTo(Model\User::class, 'change_by_id');
31
    }
32
33
    /**
34
     * @return mixed
35
     */
36
    public function model()
37
    {
38
        return $this->morphTo();
39
    }
40
41
    abstract public function belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null);
42
    abstract public function morphTo($name = null, $type = null, $id = null);
43
}
44