Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Query\Events; |
| 4 | |
| 5 | use LdapRecord\Query\Builder; |
| 6 | |
| 7 | class QueryExecuted |
| 8 | { |
| 9 | /** |
| 10 | * The LDAP filter that was used for the query. |
| 11 | * |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 12 | * @var Builder |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 13 | */ |
| 14 | protected $query; |
| 15 | |
| 16 | /** |
| 17 | * The number of milliseconds it took to execute the query. |
| 18 | * |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 19 | * @var ?float |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 20 | */ |
| 21 | protected $time; |
| 22 | |
| 23 | /** |
| 24 | * Constructor. |
| 25 | * |
| 26 | * @param Builder $query |
| 27 | * @param null|float $time |
| 28 | */ |
| 29 | public function __construct(Builder $query, $time = null) |
| 30 | { |
| 31 | $this->query = $query; |
| 32 | $this->time = $time; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Returns the LDAP filter that was used for the query. |
| 37 | * |
| 38 | * @return Builder |
| 39 | */ |
| 40 | public function getQuery() |
| 41 | { |
| 42 | return $this->query; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Returns the number of milliseconds it took to execute the query. |
| 47 | * |
| 48 | * @return float|null |
| 49 | */ |
| 50 | public function getTime() |
| 51 | { |
| 52 | return $this->time; |
| 53 | } |
| 54 | } |