public function testClearSetGetSkipSavingInformation() { MassEditInsufficientPermissionSkipSavingUtil::clear('someModel'); MassEditInsufficientPermissionSkipSavingUtil::setByModelIdAndName('someModel', 1, 'a'); MassEditInsufficientPermissionSkipSavingUtil::setByModelIdAndName('someModel', 2, 'b'); MassEditInsufficientPermissionSkipSavingUtil::setByModelIdAndName('someModel', 3, 'c'); $this->assertEquals(3, MassEditInsufficientPermissionSkipSavingUtil::getCount('someModel')); $data = MassEditInsufficientPermissionSkipSavingUtil::getAll('someModel'); $compareData = array(1 => 'a', 2 => 'b', 3 => 'c'); $this->assertEquals($compareData, $data); }
/** * Called only during a mulitple phase save from mass edit. This occurs if the quantity of models to save * is greater than the pageSize. This signals a save that must be conducted in phases where each phase * updates a quantity of models no greater than the page size. */ protected function processMassEditProgressSave($modelClassName, $pageSize, $title, $dataProvider = null) { // TODO: @Shoaibi/@Jason: Low: Deprecated // trigger_error('Deprecated'); assert('$dataProvider == null || $dataProvider instanceof CDataProvider'); $listModel = new $modelClassName(false); $selectedRecordCount = static::getSelectedRecordCountByResolvingSelectAllFromGet($dataProvider); PostUtil::sanitizePostForSavingMassEdit($modelClassName); $this->saveMassEdit(get_class($listModel), $modelClassName, $selectedRecordCount, $dataProvider, $_GET[$modelClassName . '_page'], $pageSize); $view = $this->makeMassEditProgressView($listModel, $_GET[$modelClassName . '_page'], $selectedRecordCount, $this->getMassEditProgressStartFromGet($modelClassName, $pageSize), $pageSize, $title, MassEditInsufficientPermissionSkipSavingUtil::getCount($modelClassName)); echo $view->renderRefreshJSONScript(); }