Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SearchResults.php
Go to the documentation of this file.
1 <?php
9 
11 
17 {
21  const ENTITY_TYPE = 'searchResults';
22 
27  const SEARCH_RESULT = '\\' . \Magento\Framework\Api\SearchResults::class;
28 
34  protected function _getClassProperties()
35  {
36  return [];
37  }
38 
44  protected function _getClassMethods()
45  {
46  $getItems = [
47  'name' => 'getItems',
48  'parameters' => [],
49  'body' => "return parent::getItems();",
50  'docblock' => [
51  'shortDescription' => 'Returns array of items',
52  'tags' => [
53  [
54  'name' => 'return',
55  'description' => $this->getSourceClassName() . '[]',
56  ],
57  ],
58  ],
59  ];
60  return [$getItems];
61  }
62 
68  protected function _getDefaultConstructorDefinition()
69  {
70  return [];
71  }
72 
78  protected function _generateCode()
79  {
80  $this->_classGenerator->setName($this->_getResultClassName())
81  ->setExtendedClass('\\' . \Magento\Framework\Api\SearchResults::class)
82  ->addMethods($this->_getClassMethods());
83  return $this->_getGeneratedCode();
84  }
85 }