Constraint.php 997 Bytes
Newer Older
1 2
<?php

Michael Moravec's avatar
Michael Moravec committed
3 4
declare(strict_types=1);

5 6
namespace Doctrine\DBAL\Schema;

7 8
use Doctrine\DBAL\Platforms\AbstractPlatform;

9
/**
Leo's avatar
Leo committed
10
 * Marker interface for constraints.
11 12 13
 */
interface Constraint
{
14
    public function getName() : string;
15

16
    public function getQuotedName(AbstractPlatform $platform) : string;
17

Benjamin Morel's avatar
Benjamin Morel committed
18 19 20 21
    /**
     * Returns the names of the referencing table columns
     * the constraint is associated with.
     *
22
     * @return array<int, string>
Benjamin Morel's avatar
Benjamin Morel committed
23
     */
24
    public function getColumns() : array;
25

26 27 28 29 30 31 32 33
    /**
     * Returns the quoted representation of the column names
     * the constraint is associated with.
     *
     * But only if they were defined with one or a column name
     * is a keyword reserved by the platform.
     * Otherwise the plain unquoted value as inserted is returned.
     *
34
     * @param AbstractPlatform $platform The platform to use for quotation.
35
     *
36
     * @return array<int, string>
37
     */
38
    public function getQuotedColumns(AbstractPlatform $platform) : array;
Benjamin Eberlei's avatar
Benjamin Eberlei committed
39
}