Passed
Push — master ( 348272...316c2a )
by Giacomo
14:14
created

MDModel::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 1
f 0
1
<?php
2
namespace OfflineAgency\MongoAutoSync\Http\Models;
3
4
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
5
use OfflineAgency\MongoAutoSync\Traits\ModelAdditionalMethod;
6
use OfflineAgency\MongoAutoSync\Traits\MongoSyncTrait;
7
8
class MDModel extends Eloquent
9
{
10
    use MongoSyncTrait, ModelAdditionalMethod;
0 ignored issues
show
Bug introduced by
The trait OfflineAgency\MongoAutoSync\Traits\MongoSyncTrait requires the property $ref_id which is not provided by OfflineAgency\MongoAutoSync\Http\Models\MDModel.
Loading history...
introduced by
The trait OfflineAgency\MongoAutoS...s\ModelAdditionalMethod requires some properties which are not provided by OfflineAgency\MongoAutoSync\Http\Models\MDModel: $author, $mongoRelation, $description, $items, $shortDescription, $img_evidence_text, $excerption, $title
Loading history...
11
12
    protected $connection = 'mongodb';
13
    protected $dates = [
14
        'deleted_at',
15
        'created_at',
16
        'updated_at'
17
    ];
18
19
    /**
20
     * @return mixed
21
     */
22
    public function getId()
23
    {
24
        return $this->id;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getCollection()
31
    {
32
        return $this->collection;
33
    }
34
35
    /**
36
     *
37
     * @param int $size
38
     *
39
     * @return mixed
40
     */
41
    public function getRandom($size = 3)
42
    {
43
        return $this->all()->random($size);
44
    }
45
}
46