Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/framework/Setup/Declaration/Schema/Dto/Constraints/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/framework/Setup/Declaration/Schema/Dto/Constraints/Internal.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Framework\Setup\Declaration\Schema\Dto\Constraints;

use Magento\Framework\Setup\Declaration\Schema\Dto\Column;
use Magento\Framework\Setup\Declaration\Schema\Dto\Constraint;
use Magento\Framework\Setup\Declaration\Schema\Dto\ElementDiffAwareInterface;
use Magento\Framework\Setup\Declaration\Schema\Dto\Table;

/**
 * Internal key constraint is constraint that add KEY onto table columns, on which it is declared.
 * All columns that are holded in this constraint are represented as unique vector.
 */
class Internal extends Constraint implements ElementDiffAwareInterface
{
    /**
     * As we can have only one primary key. It name should be always PRIMARY/
     */
    const PRIMARY_NAME = "PRIMARY";

    /**
     * @var array
     */
    private $columns;

    /**
     * Internal constructor.
     *
     * @param string $name
     * @param string $type
     * @param Table $table
     * @param string $nameWithoutPrefix
     * @param array $columns
     */
    public function __construct(
        $name,
        $type,
        Table $table,
        string $nameWithoutPrefix,
        array $columns
    ) {
        parent::__construct($name, $type, $table, $nameWithoutPrefix);
        $this->columns = $columns;
    }

    /**
     * Get key columns.
     *
     * @return Column[]
     */
    public function getColumns()
    {
        return $this->columns;
    }

    /**
     * Retrieve column names.
     *
     * @return array
     */
    public function getColumnNames()
    {
        return array_map(
            function (Column $column) {
                return $column->getName();
            },
            $this->getColumns()
        );
    }

    /**
     * @inheritdoc
     */
    public function getDiffSensitiveParams()
    {
        return [
            'type' => $this->getType(),
            'columns' => $this->getColumnNames()
        ];
    }
}

Spamworldpro Mini