0
drupal 8 필드 콜렉션에 파일 업로드를 만들었지 만 얻지는 않습니다.drupal 8에서 필드 콜렉션 무제한 필드를 저장하는 방법은 무엇입니까?
제게 제안 해주세요. 내가 할 수있는 것 ?
$node_data = [
'type' => ur_content_type,
'title' => 'ur title,
'langcode' => $this->languageManager()
->getCurrentLanguage()
->getId(),
];
$node = Node::create($node_data);
$node->save();
$file_content = my url of file
$directory = 'public://';
$file = file_save_data($file_content, $directory .
basename($url), FILE_EXISTS_REPLACE);
$fc->field_collect_filed_unlimited->setValue($file->id());
$fc->setHostEntity($cv_node);
$fc->save();
$Node->save();