I am using the following code to save an asset that has been downloaded to the storage/runtime/temp directory from an external API
$response = craft()->assets->insertFileByLocalPath(
$tempPath,
$photo['FileName'],
$folderId,
AssetConflictResolution::Replace
);
// if the response is a success, get the file id
if ($response && $response->isSuccess()) {
$fileIds[] = $response->getDataItem('fileId');
}
In this example $photo[]
array is the response from the api with all photo information. What I need to do is also save $photo['PhotoId'] to a field I have setup on the photo asset source in Craft.
I can't however find an example of how to achieve this. Does anyone know how?