mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°1627 - Ticket ref sometimes duplicate
add MakeInsertQuery() to legacy
This commit is contained in:
@@ -1678,6 +1678,25 @@ class DBObjectSearch extends DBSearch
|
||||
return $sRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an INSERT statement.
|
||||
* Note : unlike `RenderUpdate` and `RenderSelect`, it is limited to one and only one table.
|
||||
*
|
||||
* @param array $aValues is an array of $sAttCode => $value
|
||||
* @param array $aArgs
|
||||
*
|
||||
* @return string
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function MakeInsertQuery($aValues, $aArgs = array())
|
||||
{
|
||||
$oSQLObjectQueryBuilder = new SQLObjectQueryBuilder($this);
|
||||
$oSQLQuery = $oSQLObjectQueryBuilder->MakeSQLObjectUpdateQuery($aValues);
|
||||
$aScalarArgs = MetaModel::PrepareQueryArguments($aArgs, $this->GetInternalParams());
|
||||
$sRet = $oSQLQuery->RenderInsert($aScalarArgs);
|
||||
return $sRet;
|
||||
}
|
||||
|
||||
public function GetSQLQueryStructure($aAttToLoad, $bGetCount, $aGroupByExpr = null, $aSelectedClasses = null, $aSelectExpr = null)
|
||||
{
|
||||
// Hide objects that are not visible to the current user
|
||||
|
||||
Reference in New Issue
Block a user