Skip to content

Commit

Permalink
Merge pull request #4 from LinguaLeo/feature/dev-3118-sql-slaveRouting
Browse files Browse the repository at this point in the history
DEV-3118 canBeReadFromSlave Criteria flag
  • Loading branch information
rdmrcv committed Nov 30, 2015
2 parents c4ccfae + 9e183e5 commit 3605bf3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/LinguaLeo/DataQuery/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Criteria
public $orderBy;
public $upsert;
public $aggregations;
public $canBeReadFromSlave;

public function __construct($location, array $meta = [])
{
Expand Down Expand Up @@ -144,4 +145,9 @@ public function setMeta($name, $value)
$this->meta[$name] = $value;
return $this;
}

public function canBeReadFromSlave($flag)
{
$this->canBeReadFromSlave = $flag;
}
}

1 comment on commit 3605bf3

@regeda
Copy link
Contributor

@regeda regeda commented on 3605bf3 Dec 14, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это мрак!

Criteria всегда была независима от представления данных и роутинга к ним. Какие запросы перенаправлять на слейв должна решать имлементация QueryInterface. Что бы передавать параметры, специфичные для реализации, был сделан параметр $meta. Can you refactor that?

Please sign in to comment.