Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Schema;
4
 
5
use Illuminate\Support\Fluent;
6
 
7
/**
8
 * @method ForeignKeyDefinition deferrable(bool $value = true) Set the foreign key as deferrable (PostgreSQL)
9
 * @method ForeignKeyDefinition initiallyImmediate(bool $value = true) Set the default time to check the constraint (PostgreSQL)
10
 * @method ForeignKeyDefinition on(string $table) Specify the referenced table
11
 * @method ForeignKeyDefinition onDelete(string $action) Add an ON DELETE action
12
 * @method ForeignKeyDefinition onUpdate(string $action) Add an ON UPDATE action
13
 * @method ForeignKeyDefinition references(string|array $columns) Specify the referenced column(s)
14
 */
15
class ForeignKeyDefinition extends Fluent
16
{
17
    /**
18
     * Indicate that updates should cascade.
19
     *
20
     * @return $this
21
     */
22
    public function cascadeOnUpdate()
23
    {
24
        return $this->onUpdate('cascade');
25
    }
26
 
27
    /**
28
     * Indicate that updates should be restricted.
29
     *
30
     * @return $this
31
     */
32
    public function restrictOnUpdate()
33
    {
34
        return $this->onUpdate('restrict');
35
    }
36
 
37
    /**
38
     * Indicate that deletes should cascade.
39
     *
40
     * @return $this
41
     */
42
    public function cascadeOnDelete()
43
    {
44
        return $this->onDelete('cascade');
45
    }
46
 
47
    /**
48
     * Indicate that deletes should be restricted.
49
     *
50
     * @return $this
51
     */
52
    public function restrictOnDelete()
53
    {
54
        return $this->onDelete('restrict');
55
    }
56
 
57
    /**
58
     * Indicate that deletes should set the foreign key value to null.
59
     *
60
     * @return $this
61
     */
62
    public function nullOnDelete()
63
    {
64
        return $this->onDelete('set null');
65
    }
66
}