public function QueryResult::__construct in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 src/Commands/QueryResult.php \Drupal\salesforce\Commands\QueryResult::__construct()
- 8.3 src/Commands/QueryResult.php \Drupal\salesforce\Commands\QueryResult::__construct()
QueryResult constructor.
Parameters
\Drupal\salesforce\SelectQueryInterface $query: SOQL query.
\Drupal\salesforce\SelectQueryResult $queryResult: SOQL result.
File
- src/
Commands/ QueryResult.php, line 43
Class
- QueryResult
- Adds structured metadata to RowsOfFieldsWithMetadata.
Namespace
Drupal\salesforce\CommandsCode
public function __construct(SelectQueryInterface $query, SelectQueryResult $queryResult) {
$data = [];
foreach ($queryResult
->records() as $id => $record) {
$data[$id] = $record
->fields();
}
parent::__construct($data);
$this->size = count($queryResult
->records());
$this->total = $queryResult
->size();
$this->query = $query;
}