Admin_ObjectHelperController::getBatchJobsAction PHP Метод

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

public getBatchJobsAction ( )
    public function getBatchJobsAction()
    {
        if ($this->getParam("language")) {
            $this->setLanguage($this->getParam("language"), true);
        }
        $folder = Object::getById($this->getParam("folderId"));
        $class = Object\ClassDefinition::getById($this->getParam("classId"));
        $conditionFilters = ["o_path = ? OR o_path LIKE '" . str_replace("//", "/", $folder->getRealFullPath() . "/") . "%'"];
        if ($this->getParam("filter")) {
            $conditionFilters[] = Object\Service::getFilterCondition($this->getParam("filter"), $class);
        }
        if ($this->getParam("condition")) {
            $conditionFilters[] = " (" . $this->getParam("condition") . ")";
        }
        $className = $class->getName();
        $listClass = "\\Pimcore\\Model\\Object\\" . ucfirst($className) . "\\Listing";
        $list = new $listClass();
        $list->setCondition(implode(" AND ", $conditionFilters), [$folder->getRealFullPath()]);
        $list->setOrder("ASC");
        $list->setOrderKey("o_id");
        if ($this->getParam("objecttype")) {
            $list->setObjectTypes([$this->getParam("objecttype")]);
        }
        $jobs = $list->loadIdList();
        $this->_helper->json(["success" => true, "jobs" => $jobs]);
    }