Completed
Push — master ( 658b35...b781ca )
by Richard
28s queued 23s
created

WaitingPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A waiting() 0 16 2
1
<?php
2
3
namespace XoopsModules\Publisher\Plugin;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
15
use Criteria;
16
use CriteriaCompo;
17
use WaitingPluginInterface;
18
use XoopsModules\Publisher\Helper;
19
20
/**
21
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
22
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
23
 * @author          trabis <[email protected]>
24
 * @author          Laurent JEN (aka DuGris)
25
 */
26
class WaitingPlugin implements WaitingPluginInterface
27
{
28
    /**
29
     * @return array
30
     */
31
    public function waiting()
32
    {
33
        $helper = Helper::getInstance();
34
        $ret = [];
35
        $criteria = new CriteriaCompo();
36
        $criteria->add(new Criteria('status', 1));
37
        $count = $helper->getItemHandler()->getCount($criteria);
38
        if ($count) {
39
            $ret[] = [
40
                'count' => $count,
41
                'name' => _MI_PUBLISHER_WAITING,
42
                'link' => $helper->url('admin/item.php'),
43
            ];
44
        }
45
46
        return $ret;
47
    }
48
}
49