Created
February 17, 2016 09:09
-
-
Save xboston/05c6335759fefcf65bcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Models\Traits { | |
trait Isolation | |
{ | |
/** | |
* Поиск записей в изоляционной транзакции | |
* | |
* @param null $parameters | |
* @return mixed | |
*/ | |
public function findIsolation($parameters = null){ | |
$this->getDi()->get('db')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"); | |
$data = $this->find($parameters); | |
$this->getDi()->get('db')->query("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ"); | |
return $data; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment