Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
EntityDataObjectBuilder Class Reference

Public Member Functions

 build ()
 
 withName ($name)
 
 withType ($type)
 
 withDataFields ($fields)
 
 withLinkedEntities ($linkedEntities)
 

Detailed Description

Definition at line 10 of file EntityDataObjectBuilder.php.

Member Function Documentation

◆ build()

build ( )

A function which will build an Entity Data Object with the params specified by the object.

Returns
EntityDataObject

Definition at line 57 of file EntityDataObjectBuilder.php.

58  {
59  return new EntityDataObject(
60  $this->name,
61  $this->type,
62  $this->data,
63  $this->linkedEntities,
64  null,
65  $this->vars
66  );
67  }

◆ withDataFields()

withDataFields (   $fields)

Sets the data fields on the object to the data field array specified in the argument.

Parameters
array$fields
Returns
EntityDataObjectBuilder

Definition at line 99 of file EntityDataObjectBuilder.php.

100  {
101  $this->data = $fields;
102  return $this;
103  }
$fields
Definition: details.phtml:14

◆ withLinkedEntities()

withLinkedEntities (   $linkedEntities)

Sets the linked entities specified by the user as a param for Entity Data Object creation.

Parameters
array$linkedEntities
Returns
EntityDataObjectBuilder

Definition at line 111 of file EntityDataObjectBuilder.php.

112  {
113  $this->linkedEntities = $linkedEntities;
114  return $this;
115  }

◆ withName()

withName (   $name)

Sets the name of the EntityDataObject.

Parameters
string$name
Returns
EntityDataObjectBuilder

Definition at line 75 of file EntityDataObjectBuilder.php.

76  {
77  $this->name = $name;
78  return $this;
79  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ withType()

withType (   $type)

Sets the type of the EntityDataObject.

Parameters
string$type
Returns
EntityDataObjectBuilder

Definition at line 87 of file EntityDataObjectBuilder.php.

88  {
89  $this->type = $type;
90  return $this;
91  }
$type
Definition: item.phtml:13

The documentation for this class was generated from the following file: