Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
DependencyDecorator Class Reference
Inheritance diagram for DependencyDecorator:
IndexerInterface

Public Member Functions

 __construct (IndexerInterface $indexer, DependencyInfoProviderInterface $dependencyInfoProvider, IndexerRegistry $indexerRegistry)
 
 __call (string $method, array $args)
 
 __sleep ()
 
 __clone ()
 
 getId ()
 
 getViewId ()
 
 getActionClass ()
 
 getTitle ()
 
 getDescription ()
 
 getFields ()
 
 getSources ()
 
 getHandlers ()
 
 load ($indexerId)
 
 getView ()
 
 getState ()
 
 setState (StateInterface $state)
 
 isScheduled ()
 
 setScheduled ($scheduled)
 
 isValid ()
 
 isInvalid ()
 
 isWorking ()
 
 invalidate ()
 
 getStatus ()
 
 getLatestUpdated ()
 
 reindexAll ()
 
 reindexRow ($id)
 
 reindexList ($ids)
 

Detailed Description

The decorator, which implements logic of the dependency between the indexers.

@SuppressWarnings(PHPMD.TooManyPublicMethods)

Definition at line 21 of file DependencyDecorator.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( IndexerInterface  $indexer,
DependencyInfoProviderInterface  $dependencyInfoProvider,
IndexerRegistry  $indexerRegistry 
)
Parameters
IndexerInterface$indexer
DependencyInfoProviderInterface$dependencyInfoProvider
IndexerRegistry$indexerRegistry

Definition at line 43 of file DependencyDecorator.php.

47  {
48  $this->indexer = $indexer;
49  $this->dependencyInfoProvider = $dependencyInfoProvider;
50  $this->indexerRegistry = $indexerRegistry;
51  }

Member Function Documentation

◆ __call()

__call ( string  $method,
array  $args 
)

Definition at line 56 of file DependencyDecorator.php.

57  {
58  return call_user_func_array([$this->indexer, $method], $args);
59  }
$method
Definition: info.phtml:13

◆ __clone()

__clone ( )

Definition at line 72 of file DependencyDecorator.php.

73  {
74  $this->indexer = clone $this->indexer;
75  }

◆ __sleep()

__sleep ( )
Returns
array

Definition at line 64 of file DependencyDecorator.php.

65  {
66  return ['indexer', 'dependencyInfoProvider', 'indexerRegistry'];
67  }

◆ getActionClass()

getActionClass ( )

Return indexer action class

Returns
string

Implements IndexerInterface.

Definition at line 96 of file DependencyDecorator.php.

96  : string
97  {
98  return $this->indexer->getActionClass();
99  }

◆ getDescription()

getDescription ( )

Return indexer description

Returns
string

Implements IndexerInterface.

Definition at line 112 of file DependencyDecorator.php.

112  : string
113  {
114  return $this->indexer->getDescription();
115  }

◆ getFields()

getFields ( )

Return indexer fields

Returns
array

Implements IndexerInterface.

Definition at line 120 of file DependencyDecorator.php.

120  : array
121  {
122  return $this->indexer->getFields();
123  }

◆ getHandlers()

getHandlers ( )

Return indexer handlers

Returns
array

Implements IndexerInterface.

Definition at line 136 of file DependencyDecorator.php.

136  : array
137  {
138  return $this->indexer->getHandlers();
139  }

◆ getId()

getId ( )

Return indexer ID

Returns
string

Implements IndexerInterface.

Definition at line 80 of file DependencyDecorator.php.

80  : string
81  {
82  return $this->indexer->getId();
83  }

◆ getLatestUpdated()

getLatestUpdated ( )

Return indexer or mview latest updated time

Returns
string

Implements IndexerInterface.

Definition at line 238 of file DependencyDecorator.php.

238  : string
239  {
240  return $this->indexer->getLatestUpdated();
241  }

◆ getSources()

getSources ( )

Return indexer sources

Returns
array

Implements IndexerInterface.

Definition at line 128 of file DependencyDecorator.php.

128  : array
129  {
130  return $this->indexer->getSources();
131  }

◆ getState()

getState ( )

Return related state object

Returns
StateInterface

Implements IndexerInterface.

Definition at line 161 of file DependencyDecorator.php.

161  : StateInterface
162  {
163  return $this->indexer->getState();
164  }

◆ getStatus()

getStatus ( )

Return indexer status

Returns
string

Implements IndexerInterface.

Definition at line 230 of file DependencyDecorator.php.

230  : string
231  {
232  return $this->indexer->getStatus();
233  }

◆ getTitle()

getTitle ( )

Return indexer title

Returns
string

Implements IndexerInterface.

Definition at line 104 of file DependencyDecorator.php.

104  : string
105  {
106  return $this->indexer->getTitle();
107  }

◆ getView()

getView ( )

Return related view object

Returns
\Magento\Framework\Mview\ViewInterface

Implements IndexerInterface.

Definition at line 153 of file DependencyDecorator.php.

153  : ViewInterface
154  {
155  return $this->indexer->getView();
156  }

◆ getViewId()

getViewId ( )

Return indexer's view ID

Returns
string

Implements IndexerInterface.

Definition at line 88 of file DependencyDecorator.php.

88  : string
89  {
90  return $this->indexer->getViewId();
91  }

◆ invalidate()

invalidate ( )

Set indexer invalid

Returns
void

Implements IndexerInterface.

Definition at line 218 of file DependencyDecorator.php.

219  {
220  $this->indexer->invalidate();
221  $dependentIndexerIds = $this->dependencyInfoProvider->getIndexerIdsToRunAfter($this->indexer->getId());
222  foreach ($dependentIndexerIds as $indexerId) {
223  $this->indexerRegistry->get($indexerId)->invalidate();
224  }
225  }

◆ isInvalid()

isInvalid ( )

Check whether indexer is invalid

Returns
bool

Implements IndexerInterface.

Definition at line 202 of file DependencyDecorator.php.

202  : bool
203  {
204  return $this->indexer->isInvalid();
205  }

◆ isScheduled()

isScheduled ( )

Check whether indexer is run by schedule

Returns
bool

Implements IndexerInterface.

Definition at line 178 of file DependencyDecorator.php.

178  : bool
179  {
180  return $this->indexer->isScheduled();
181  }

◆ isValid()

isValid ( )

Check whether indexer is valid

Returns
bool

Implements IndexerInterface.

Definition at line 194 of file DependencyDecorator.php.

194  : bool
195  {
196  return $this->indexer->isValid();
197  }

◆ isWorking()

isWorking ( )

Check whether indexer is working

Returns
bool

Implements IndexerInterface.

Definition at line 210 of file DependencyDecorator.php.

210  : bool
211  {
212  return $this->indexer->isWorking();
213  }

◆ load()

load (   $indexerId)

Fill indexer data from config

Parameters
string$indexerId
Returns
IndexerInterface
Exceptions

Implements IndexerInterface.

Definition at line 144 of file DependencyDecorator.php.

144  : self
145  {
146  $this->indexer->load($indexerId);
147  return $this;
148  }

◆ reindexAll()

reindexAll ( )

Regenerate full index

Returns
void
Exceptions

Implements IndexerInterface.

Definition at line 246 of file DependencyDecorator.php.

247  {
248  $this->indexer->reindexAll();
249  }

◆ reindexList()

reindexList (   $ids)

Regenerate rows in index by ID list

Parameters
int[]$ids
Returns
void
Deprecated:
See also
\Magento\Framework\Indexer\ActionInterface::executeList

Implements IndexerInterface.

Definition at line 269 of file DependencyDecorator.php.

270  {
271  $this->indexer->reindexList($ids);
272  $dependentIndexerIds = $this->dependencyInfoProvider->getIndexerIdsToRunAfter($this->indexer->getId());
273  foreach ($dependentIndexerIds as $indexerId) {
274  $dependentIndexer = $this->indexerRegistry->get($indexerId);
275  if (!$dependentIndexer->isScheduled()) {
276  $dependentIndexer->reindexList($ids);
277  }
278  }
279  }

◆ reindexRow()

reindexRow (   $id)

Regenerate one row in index by ID

Parameters
int$id
Returns
void
Deprecated:
See also
\Magento\Framework\Indexer\ActionInterface::executeList

Implements IndexerInterface.

Definition at line 254 of file DependencyDecorator.php.

255  {
256  $this->indexer->reindexRow($id);
257  $dependentIndexerIds = $this->dependencyInfoProvider->getIndexerIdsToRunAfter($this->indexer->getId());
258  foreach ($dependentIndexerIds as $indexerId) {
259  $dependentIndexer = $this->indexerRegistry->get($indexerId);
260  if (!$dependentIndexer->isScheduled()) {
261  $dependentIndexer->reindexRow($id);
262  }
263  }
264  }
$id
Definition: fieldset.phtml:14

◆ setScheduled()

setScheduled (   $scheduled)

Turn scheduled mode on/off

Parameters
bool$scheduled
Returns
void

Implements IndexerInterface.

Definition at line 186 of file DependencyDecorator.php.

187  {
188  $this->indexer->setScheduled($scheduled);
189  }

◆ setState()

setState ( StateInterface  $state)

Set indexer state object

Parameters
StateInterface$state
Returns
IndexerInterface

Implements IndexerInterface.

Definition at line 169 of file DependencyDecorator.php.

169  : self
170  {
171  $this->indexer->setState($state);
172  return $this;
173  }

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