Completed
Pull Request — develop (#891)
by Luke
04:11
created

AbstractMviewIndexerCommand::getIndexers()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.2
c 0
b 0
f 0
cc 4
eloc 9
nc 6
nop 0
1
<?php
2
3
namespace N98\Magento\Command\Indexer;
4
5
use N98\Magento\Command\AbstractMagentoCommand;
6
7
class AbstractMviewIndexerCommand extends AbstractMagentoCommand
8
{
9
    /**
10
     * @return \Enterprise_Mview_Model_Resource_Metadata_Collection
11
     */
12
    public function getMetaDataCollection()
13
    {
14
        $collection = $this->_getModel('enterprise_mview/metadata')->getCollection();
0 ignored issues
show
Bug introduced by
The call to _getModel() misses a required argument $mage2class.

This check looks for function calls that miss required arguments.

Loading history...
15
        return $collection;
16
    }
17
18
    /**
19
     * @return array[]
20
     */
21
    protected function getIndexers()
22
    {
23
        /** @var \Enterprise_Index_Helper_Data $helper */
24
        $helper = $this->_getHelper('enterprise_index');
0 ignored issues
show
Bug introduced by
The call to _getHelper() misses a required argument $mage2class.

This check looks for function calls that miss required arguments.

Loading history...
25
26
        $indexers = array();
27
        foreach ($helper->getIndexers(true) as $indexer) {
28
            $indexers[(string) $indexer->index_table] = $indexer;
29
        }
30
31
        foreach ($indexers as $indexerKey => $indexerData) {
32
            if (!isset($indexerData->action_model->changelog)) {
33
                unset($indexers[$indexerKey]);
34
            }
35
        }
36
37
        return $indexers;
38
    }
39
40
    /**
41
     * @return \Enterprise_Mview_Model_Client
42
     */
43
    protected function getMviewClient()
44
    {
45
        return $this->_getModel('enterprise_mview/client');
0 ignored issues
show
Bug introduced by
The call to _getModel() misses a required argument $mage2class.

This check looks for function calls that miss required arguments.

Loading history...
46
    }
47
}
48