AAAAhome/academiac/www/administrator/components/com_csvi/tables/com_virtuemart/categories_xref.php000060400000004053151457541640027264 0ustar00check(); if($k) { $ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key, false ); } else { $ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key ); } if( !$ret ) { $this->setError(get_class( $this ).'::store failed - '.$this->_db->getErrorMsg()); return false; } else { return true; } } /** * Check if a relation already exists */ public function check() { $q = "SELECT COUNT(".$this->_tbl_key.") AS total FROM ".$this->_tbl." WHERE category_parent_id = ".$this->category_parent_id." AND category_child_id = ".$this->category_child_id; $this->_db->setQuery($q); $result = $this->_db->loadResult(); if ($result > 0) return true; else return false; } /** * Reset the keys including primary key * * @copyright * @author RolandD * @todo * @see * @access public * @param * @return * @since 4.0 */ public function reset() { // Get the default values for the class from the table. foreach ($this->getFields() as $k => $v) { // If the property is not private, reset it. if (strpos($k, '_') !== 0) { $this->$k = NULL; } } } } ?>