ElasticsearchMigration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 20
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A migrationSteps() 0 6 1
1
<?php
2
namespace Triadev\EsMigration\Models\Entity;
3
4
use Illuminate\Database\Eloquent\Model;
5
use Illuminate\Database\Eloquent\Relations\HasMany;
6
7
/**
8
 * @property integer $id
9
 * @property string $migration
10
 * @property string $status
11
 * @property string|null $error
12
 * @property string $created_at
13
 * @property string $updated_at
14
 */
15
class ElasticsearchMigration extends Model
16
{
17
    /**
18
     * The table associated with the model.
19
     *
20
     * @var string
21
     */
22
    protected $table = 'triadev_elasticsearch_migration';
23
    
24
    /**
25
     * Get migration steps
26
     *
27
     * @return HasMany
28
     */
29
    public function migrationSteps() : HasMany
30
    {
31
        return $this->hasMany(ElasticsearchMigrationStep::class, 'migration_id')
32
            ->orderBy(
33
                'priority',
34
                'asc'
35
            );
36
    }
37
}
38