comparison core/modules/views/src/ResultRow.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\views;
4
5 /**
6 * A class representing a view result row.
7 */
8 class ResultRow {
9
10 /**
11 * The entity for this result.
12 *
13 * @var \Drupal\Core\Entity\EntityInterface
14 */
15 public $_entity = NULL;
16
17 /**
18 * An array of relationship entities.
19 *
20 * @var \Drupal\Core\Entity\EntityInterface[]
21 */
22 public $_relationship_entities = [];
23
24 /**
25 * An incremental number which represents the row in the entire result.
26 *
27 * @var int
28 */
29 public $index;
30
31 /**
32 * Constructs a ResultRow object.
33 *
34 * @param array $values
35 * (optional) An array of values to add as properties on the object.
36 */
37 public function __construct(array $values = []) {
38 foreach ($values as $key => $value) {
39 $this->{$key} = $value;
40 }
41 }
42
43 /**
44 * Resets the _entity and _relationship_entities properties.
45 */
46 public function resetEntityData() {
47 $this->_entity = NULL;
48 $this->_relationship_entities = [];
49 }
50
51 }