MultiTenantShardChoser.php 436 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

namespace Doctrine\DBAL\Sharding\ShardChoser;

use Doctrine\DBAL\Sharding\PoolingShardConnection;

/**
 * The MultiTenant Shard choser assumes that the distribution value directly
 * maps to the shard id.
 */
class MultiTenantShardChoser implements ShardChoser
{
Benjamin Morel's avatar
Benjamin Morel committed
13 14 15
    /**
     * {@inheritdoc}
     */
16 17 18 19 20
    public function pickShard($distributionValue, PoolingShardConnection $conn)
    {
        return $distributionValue;
    }
}