/**
* Method to append the primary keys for this table to a query.
*
* @param DatabaseQuery $query A query object to append.
* @param mixed $pk Optional primary key parameter.
*
* @return void
*
* @since 3.1.4
*/
public function appendPrimaryKeys($query, $pk = null)
{
if (\is_null($pk)) {
foreach ($this->_tbl_keys as $k) {
$query->where($this->_db->quoteName($k) . ' = ' . $this->_db->quote($this->{$k}));
}
} else {
if (\is_string($pk)) {
$pk = array($this->_tbl_key => $pk);
}
$pk = (object) $pk;
foreach ($this->_tbl_keys as $k) {
$query->where($this->_db->quoteName($k) . ' = ' . $this->_db->quote($pk->{$k}));
}
}
}