/** * Clean values of all variables of the object for storage. * also add slashes and quote string wherever needed * * @param XoopsObject $object object to act on * * @return bool true if successful * @access public */ public function cleanVars(XoopsObject $object) { $vars = $object->getVars(); $object->cleanVars = array(); foreach ($vars as $k => $v) { if (!$v["changed"]) { continue; } $object->cleanVars[$k] = Dtype::cleanVar($object, $k); } $object->unsetDirty(); $errors = $object->getErrors(); return empty($errors) ? true : false; }
/** * clean values of all variables of the object for storage. * also add slashes whereever needed * * @param bool $quote add quotes for db storage * * @return bool true if successful * @access public */ public function cleanVars($quote = true) { $ts = \MyTextSanitizer::getInstance(); $existing_errors = $this->getErrors(); $this->_errors = array(); foreach ($this->vars as $k => $v) { if (!$v['changed']) { } else { $this->cleanVars[$k] = Dtype::cleanVar($this, $k, $quote); } } if (count($this->_errors) > 0) { $this->_errors = array_merge($existing_errors, $this->_errors); return false; } // $this->_errors = array_merge($existing_errors, $this->_errors); $this->unsetDirty(); return true; }
/** * clean values of all variables of the object for storage. * * @return bool true if successful */ public function cleanVars() { $existing_errors = $this->getErrors(); $this->errors = array(); foreach ($this->vars as $k => $v) { if (!$v['changed']) { } else { $this->cleanVars[$k] = Dtype::cleanVar($this, $k); } } if (count($this->errors) > 0) { $this->errors = array_merge($existing_errors, $this->errors); return false; } // $this->_errors = array_merge($existing_errors, $this->_errors); $this->unsetDirty(); return true; }