Issues (172)

app/Source.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use LaravelEnso\Tables\Traits\TableCache;
7
8
class Source extends Model
9
{
10
    use TableCache;
11
    // public function __construct(Array $attributes = [])
12
    // {
13
    //     parent::__construct($attributes);
14
    //     $db = \Session::get('db');
15
    //     error_log('+++++++++++++++++++++++++++++++++++'.$db);
16
    //     if(empty($db)) {
17
    //         $db = env('DB_DATABASE', 'enso');
18
    //     }
19
    //     if($db === env('DB_DATABASE')) {
20
    //         $key = 'database.connections.mysql.database';
21
    //         config([$key => $db]);
22
    //     } else {
23
    //         $key = 'database.connections.mysql.database';
24
    //         config([$key => $db]);
25
    //     }
26
    //     \DB::purge('mysql');
27
    //     \DB::reconnect('mysql');
28
    //     $this->setConnection('mysql');
29
    //     error_log('-----------------------------------'.$this->getConnection()->getDatabaseName());
30
    // }
31
    /**
32
     * The "type" of the auto-incrementing ID.
33
     *
34
     * @var string
35
     */
36
    protected $keyType = 'integer';
37
38
    protected $fillable = ['sour', 'titl', 'auth', 'data', 'text', 'publ', 'abbr', 'name', 'description', 'repository_id', 'author_id', 'publication_id', 'type_id', 'is_active', 'group', 'gid', 'quay', 'page'];
39
40
    protected $attributes = ['is_active' => false];
41
42
    protected $casts = ['is_active' => 'boolean'];
43
44
    public function repositories()
45
    {
46
        return $this->belongsTo(Repository::class);
47
    }
48
49
    public function citations()
50
    {
51
        return $this->hasMany(Citations::class);
0 ignored issues
show
The type App\Citations was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
52
    }
53
54
    public function getCitationListAttribute()
55
    {
56
        return $this->citations()->pluck('citation.id');
57
    }
58
}
59