Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EntityDataObjectBuilder.php
Go to the documentation of this file.
1 <?php
6 namespace tests\unit\Util;
7 
9 
11 {
17  private $data = [
18  "name" => "Hopper",
19  "gpa" => "3.5678",
20  "phone" => "5555555",
21  "isprimary" => "true"
22  ];
23 
29  private $name = "testDataObject";
30 
36  private $type = "testType";
37 
43  private $linkedEntities = [];
44 
50  private $vars = [];
51 
57  public function build()
58  {
59  return new EntityDataObject(
60  $this->name,
61  $this->type,
62  $this->data,
63  $this->linkedEntities,
64  null,
65  $this->vars
66  );
67  }
68 
75  public function withName($name)
76  {
77  $this->name = $name;
78  return $this;
79  }
80 
87  public function withType($type)
88  {
89  $this->type = $type;
90  return $this;
91  }
92 
99  public function withDataFields($fields)
100  {
101  $this->data = $fields;
102  return $this;
103  }
104 
111  public function withLinkedEntities($linkedEntities)
112  {
113  $this->linkedEntities = $linkedEntities;
114  return $this;
115  }
116 }
$fields
Definition: details.phtml:14