forked from aternosorg/php-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryResultCollection.php
More file actions
42 lines (38 loc) · 901 Bytes
/
QueryResultCollection.php
File metadata and controls
42 lines (38 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Aternos\Model\Query;
/**
* Class QueryResultCollection
*
* Contains multiple QueryResults for Update and Delete queries
*
* @package Aternos\Model\Query
*/
class QueryResultCollection extends QueryResult
{
/**
* @var array|QueryResult[]
*/
protected array $models = [];
/**
* QueryResultCollection constructor.
* @param bool $success
* @param array|QueryResult[] $result
* @param string|null $queryString
*/
public function __construct(bool $success, $result = [], ?string $queryString = null)
{
parent::__construct($success, $result, $queryString);
}
/**
* @return bool
*/
public function wasSuccessful(): bool
{
foreach ($this->models as $result) {
if (!$result->wasSuccessful()) {
return false;
}
}
return true;
}
}