Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UniqueConstraintsResolver.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
24  public function resolve(Table $table)
25  {
26  $primaryKey = $table->getPrimaryConstraint();
27  if ($primaryKey) {
28  return $primaryKey->getColumnNames();
29  }
30 
31  $constraints = $table->getConstraints();
32 
33  foreach ($constraints as $constraint) {
34  if ($constraint instanceof Internal) {
35  return $constraint->getColumnNames();
36  }
37  }
38 
39  return false;
40  }
41 }
$table
Definition: trigger.php:14