YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/PickListDependency/models/ListView.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

/**
 * Settings pickList dependency list view model file.
 *
 * @package Settings.Model
 *
 * @copyright YetiForce S.A.
 * @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 * @author Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
 * @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
 */
/**
 * Settings pickList dependency list view model class.
 */
class Settings_PickListDependency_ListView_Model extends Settings_Vtiger_ListView_Model
{
    /** {@inheritdoc} */
    public function getBasicListQuery(): App\Db\Query
    {
        $module = $this->getModule();
        $query = (new App\Db\Query())->from($module->getBaseTable());
        $sourceModule = $this->get('sourceModule');
        if ($sourceModule) {
            $query->where(['tabid' => \App\Module::getModuleId($sourceModule)]);
        }
        return $query;
    }
}