/** * Clear the cache of the forms when a validation setting has changed. * * @param \DataContainer $dataContainer The data container. * * @return void */ public function clearCache($dataContainer) { $collection = \FormModel::findBy(['fv_active=1', 'fv_setting=?'], $dataContainer->id); if ($collection) { foreach ($collection as $form) { $this->cache->remove($form->id); } } }
/** * Get the validation javascript as file path. * * @param \FormModel $model The form model. * @param \FormFieldModel[] $fields The form fields. * @param ValidationModel $settings The validation settings. * * @return string */ protected function getValidationJavascript($model, $fields, $settings) { if (!$this->cache->isCached($model->id, $this->locale) || \Config::get('bypassCache')) { $validation = $this->assembler->assemble($model, $fields, $settings, $this->locale); $javascript = $this->buildJavascript($validation); $this->cache->save($model->id, $javascript, $this->locale); } return $this->cache->filename($model->id, $this->locale); }
/** * Clear the cached form field when form changed. * * @param \DataContainer $dataContainer The data container driver. * * @return void */ public function clearCache($dataContainer) { $this->cache->remove($dataContainer->activeRecord->pid); }
/** * Clear the cached form when form changed. * * @param \DataContainer $dataContainer The data container driver. * * @return void */ public function clearCache($dataContainer) { $this->cache->remove($dataContainer->id); }