enabled = (bool)$enabled; $this->duration = (int)$duration; } /** * @param DataTableInterface $table * * @return void */ public function modifyTable(DataTableInterface $table) { // $options = $table->getOptions()->toArray(); // $options['columns'] = $table->getColumns()->toArray(); // $table->getOptions()->setOption('revision', md5(json_encode($options))); $table->getOptions()->setOption('stateSave', $this->enabled); $table->getOptions()->setOption('stateDuration', $this->duration); } /** * @return void */ public function enable() { $this->enabled = true; } /** * @return void */ public function disable() { $this->enabled = false; } /** * @return bool */ public function isEnabled() { return $this->enabled; } /** * @return int */ public function getDuration() { return $this->duration; } /** * @param int $duration * * @return void */ public function setDuration($duration) { $this->duration = (int)$duration; } }