저는 Drupal 7과 엔티티 모듈을 사용하고 있습니다. 속성 유형 설정이 property이고, XML 파일에서 콘텐츠 유형을 만드는 것이고, 올바른 것입니다. 데이터 및 I는 필드에 삽입을 단순화 entity_metadata_wrapper가 사용하고) (엔티티 메타 데이터 래퍼를 사용하여 데이터를 저장하지 않습니다.
private function newProperty($propValues) {
global $user;
$values = array(
'type' => 'property',
'uid' => $user->uid,
'status' => 1,
'comment' => 1,
'promote' => 0,
);
$entity = entity_create('node', $values);
$ewrapper = entity_metadata_wrapper('node', $entity);
$ewrapper->title->value=$propValues->price_text;
$ewrapper->field_property_expert_agent_ref->value =$this->xml_attribute($propValues, 'reference');
foreach ($this->valuesToFetch() as $key=>$value) {
$ewrapper->{$value}->value=$propValues->$key;
}
$ewrapper->save();
entity_save('node', $entity);
}
$를 propValues 값 $ this-> valuesToFetch을 배열을 가지고 : 여기서
하면 I가 사용하고있어서 인 예 : 'department'=> 'field_property_department', v를 확인하기 위해 디버깅 코드를 추가했습니다. alues가 전달되면 ct가 생성되지만 값은 비어 있습니다.
내가 뭘 잘못하고 있니? > 설정() 메소드 -를 위해
https://drupal.org/node/1021556
그것을 실제로 게시 한 이래로 얼마 동안 있었지만 결국 내가 한 일을 살펴 보았습니다. – Darren