Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataObjectService.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\TestModule4\Service\V1\Entity\DataObjectResponseFactory;
12 
14 {
18  protected $responseFactory;
19 
23  public function __construct(DataObjectResponseFactory $responseFactory)
24  {
25  $this->responseFactory = $responseFactory;
26  }
27 
31  public function getData($id)
32  {
33  return $this->responseFactory->create()->setEntityId($id)->setName("Test");
34  }
35 
40  {
41  return $this->responseFactory->create()->setEntityId($id)->setName($request->getName());
42  }
43 
48  {
49  return $this->responseFactory->create()->setEntityId($id)->setName($request->getDetails()->getName());
50  }
51 
58  public function scalarResponse($id)
59  {
60  return $id;
61  }
62 
67  {
68  return $this->responseFactory->create()->setEntityId($id)->setName($request->getName());
69  }
70 }
nestedData($id, NestedDataObjectRequest $request)
$id
Definition: fieldset.phtml:14
__construct(DataObjectResponseFactory $responseFactory)
extensibleDataObject($id, ExtensibleRequestInterface $request)