MultiTenantShardChoser.php 436 B

1234567891011121314151617181920
  1. <?php
  2. namespace Doctrine\DBAL\Sharding\ShardChoser;
  3. use Doctrine\DBAL\Sharding\PoolingShardConnection;
  4. /**
  5. * The MultiTenant Shard choser assumes that the distribution value directly
  6. * maps to the shard id.
  7. */
  8. class MultiTenantShardChoser implements ShardChoser
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function pickShard($distributionValue, PoolingShardConnection $conn)
  14. {
  15. return $distributionValue;
  16. }
  17. }