Constraint.php 993 Bytes
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL\Schema;

5 6
use Doctrine\DBAL\Platforms\AbstractPlatform;

7
/**
Leo's avatar
Leo committed
8
 * Marker interface for constraints.
9 10 11
 */
interface Constraint
{
Benjamin Morel's avatar
Benjamin Morel committed
12 13 14
    /**
     * @return string
     */
15 16
    public function getName();

Benjamin Morel's avatar
Benjamin Morel committed
17 18 19
    /**
     * @return string
     */
20 21
    public function getQuotedName(AbstractPlatform $platform);

Benjamin Morel's avatar
Benjamin Morel committed
22 23 24 25
    /**
     * Returns the names of the referencing table columns
     * the constraint is associated with.
     *
26
     * @return string[]
Benjamin Morel's avatar
Benjamin Morel committed
27
     */
28
    public function getColumns();
29

30 31 32 33 34 35 36 37
    /**
     * 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.
     *
38
     * @param AbstractPlatform $platform The platform to use for quotation.
39
     *
40
     * @return string[]
41
     */
42
    public function getQuotedColumns(AbstractPlatform $platform);
Benjamin Eberlei's avatar
Benjamin Eberlei committed
43
}