ShardChoser.php 519 B

123456789101112131415161718192021
  1. <?php
  2. namespace Doctrine\DBAL\Sharding\ShardChoser;
  3. use Doctrine\DBAL\Sharding\PoolingShardConnection;
  4. /**
  5. * Given a distribution value this shard-choser strategy will pick the shard to
  6. * connect to for retrieving rows with the distribution value.
  7. */
  8. interface ShardChoser
  9. {
  10. /**
  11. * Picks a shard for the given distribution value.
  12. *
  13. * @param string|int $distributionValue
  14. *
  15. * @return string|int
  16. */
  17. public function pickShard($distributionValue, PoolingShardConnection $conn);
  18. }