/** * Validate that the primary key has been set. * * @return boolean True if the primary key(s) have been set. * * @since 1.5.2 */ public function hasPrimaryKey() { // For Joomla 3.2+ a native method has been provided if (method_exists(get_parent_class(), 'hasPrimaryKey')) { return parent::hasPrimaryKey(); } // Otherwise, it checks if the only key field compatible for older Joomla versions is set or not if (isset($this->_tbl_key) && !empty($this->_tbl_key) && empty($this->{$this->_tbl_key})) { return false; } return true; }