Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
5 / 5
MySQLConstraintMapping
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
5 / 5
 fromResultSet
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 getForeignColumn
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getLocalColumn
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
declare(strict_types = 1);
namespace Siesta\Driver\MySQL\MetaData;
use Siesta\Database\MetaData\ConstraintMappingMetaData;
use Siesta\Database\ResultSet;
/**
 * @author Gregor Müller
 */
class MySQLConstraintMapping implements ConstraintMappingMetaData
{
    const COLUMN_NAME = "COLUMN_NAME";
    const REFERENCED_COLUMN_NAME = "REFERENCED_COLUMN_NAME";
    /**
     * @var string
     */
    protected $localColumn;
    /**
     * @var string
     */
    protected $foreignColumn;
    /**
     * @param ResultSet $resultSet
     */
    public function fromResultSet(ResultSet $resultSet)
    {
        $this->localColumn = $resultSet->getStringValue(self::COLUMN_NAME);
        $this->foreignColumn = $resultSet->getStringValue(self::REFERENCED_COLUMN_NAME);
    }
    /**
     * @return string
     */
    public function getForeignColumn() : string
    {
        return $this->foreignColumn;
    }
    /**
     * @return string
     */
    public function getLocalColumn() : string
    {
        return $this->localColumn;
    }
}