Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Doctrine\DBAL\Event;
4
 
5
use Doctrine\DBAL\Platforms\AbstractPlatform;
6
use Doctrine\DBAL\Schema\Table;
7
 
8
use function array_merge;
9
use function func_get_args;
10
use function is_array;
11
 
12
/**
13
 * Event Arguments used when SQL queries for creating tables are generated inside {@see AbstractPlatform}.
14
 *
15
 * @deprecated
16
 */
17
class SchemaCreateTableEventArgs extends SchemaEventArgs
18
{
19
    private Table $table;
20
 
21
    /** @var mixed[][] */
22
    private array $columns;
23
 
24
    /** @var mixed[] */
25
    private array $options;
26
 
27
    private AbstractPlatform $platform;
28
 
29
    /** @var string[] */
30
    private array $sql = [];
31
 
32
    /**
33
     * @param mixed[][] $columns
34
     * @param mixed[]   $options
35
     */
36
    public function __construct(Table $table, array $columns, array $options, AbstractPlatform $platform)
37
    {
38
        $this->table    = $table;
39
        $this->columns  = $columns;
40
        $this->options  = $options;
41
        $this->platform = $platform;
42
    }
43
 
44
    /** @return Table */
45
    public function getTable()
46
    {
47
        return $this->table;
48
    }
49
 
50
    /** @return mixed[][] */
51
    public function getColumns()
52
    {
53
        return $this->columns;
54
    }
55
 
56
    /** @return mixed[] */
57
    public function getOptions()
58
    {
59
        return $this->options;
60
    }
61
 
62
    /** @return AbstractPlatform */
63
    public function getPlatform()
64
    {
65
        return $this->platform;
66
    }
67
 
68
    /**
69
     * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead.
70
     *
71
     * @param string|string[] $sql
72
     *
73
     * @return SchemaCreateTableEventArgs
74
     */
75
    public function addSql($sql)
76
    {
77
        $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args());
78
 
79
        return $this;
80
    }
81
 
82
    /** @return string[] */
83
    public function getSql()
84
    {
85
        return $this->sql;
86
    }
87
}