Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions core/dbobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,30 @@ public function SetIfNull($sAttCode, $value)
}
}

/**
* Helper to copy a value only if the target is currently undefined
*
* Call Copy() only of the internal representation of the target attribute is null.
*
* @api
* @see Copy()
* @see SetIfNull())
*
* @param string $sDestAttCode
* @param string $sSourceAttCode
*
* @return bool true if copy was successfull or was not performed because target attribute isn't null
*
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \Exception
*/
public function CopyIfNull($sDestAttCode, $sSourceAttCode)
{
$this->SetIfNull($sDestAttCode, $this->Get($sSourceAttCode));
return true;
}

/**
* Helper to set a value that fits the attribute max size
*
Expand Down