/** * This function will save the current state of all types to disk. A full * validation cycle is done beforehand, if any validation fails, the function * aborts and sets the $validation_errors member variable accordingly. * * @return boolean Indicating success */ function save() { if (!$this->validate()) { debug_add(count($this->validation_errors) . ' fields have failed validation, cannot save.', MIDCOM_LOG_WARN); debug_print_r('Validation errors:', $this->validation_errors); return false; } return $this->storage->store($this->types); }