summaryrefslogtreecommitdiff
path: root/tests/Unit/Models/Stub/BaseModelImplementation.php
blob: 70643b03af57da9f64b55d1d45351a0245221da6 (plain)
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
<?php

namespace Engelsystem\Test\Unit\Models\Stub;

use Engelsystem\Models\BaseModel;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;

/**
 * @property string foo
 */
class BaseModelImplementation extends BaseModel
{
    /** @var array */
    protected $fillable = ['foo'];

    /** @var int */
    public $saveCount = 0;

    /** @var QueryBuilder */
    public static $queryBuilder = null;

    /**
     * @param array $options
     * @return bool
     */
    public function save(array $options = [])
    {
        $this->saveCount++;
        return true;
    }

    /**
     * @return QueryBuilder
     */
    public static function query()
    {
        return self::$queryBuilder;
    }
}