CommonITILObject::countActiveObjectsForSupplier PHP Метод

countActiveObjectsForSupplier() публичный Метод

Count active ITIL Objects assigned to a supplier
public countActiveObjectsForSupplier ( $suppliers_id ) : integer
$suppliers_id integer ID of the Supplier
Результат integer
    function countActiveObjectsForSupplier($suppliers_id)
    {
        $linkclass = new $this->supplierlinkclass();
        $itemtable = $this->getTable();
        $itemtype = $this->getType();
        $itemfk = $this->getForeignKeyField();
        $linktable = $linkclass->getTable();
        return countElementsInTable(array($itemtable, $linktable), getEntitiesRestrictRequest("", $itemtable) . "\n                                    AND `{$linktable}`.`{$itemfk}` = `{$itemtable}`.`id`\n                                    AND `{$linktable}`.`suppliers_id` = '{$suppliers_id}'\n                                    AND `{$linktable}`.`type` = '" . CommonITILActor::ASSIGN . "'\n                                    AND `{$itemtable}`.`is_deleted` = 0\n                                    AND `{$itemtable}`.`status`\n                                    NOT IN ('" . implode("', '", array_merge($this->getSolvedStatusArray(), $this->getClosedStatusArray())) . "')");
    }
CommonITILObject