Created
April 30, 2015 22:43
-
-
Save freshjones/8ae24b6f32ee44ea265d to your computer and use it in GitHub Desktop.
save portion of node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$entity = node_load(33); | |
echo "on load: {$entity->field_test1[LANGUAGE_NONE][0]['value']}<br/>"; | |
$entity->field_test1[LANGUAGE_NONE][0]['value']='test'.rand(10,100); | |
echo "before save: {$entity->field_test1[LANGUAGE_NONE][0]['value']}<br/>"; | |
$entity2=new stdClass; | |
$entity2->nid=$entity->nid; | |
$entity2->vid=$entity->vid; | |
$entity2->type=$entity->type; | |
$entity2->field_annonce=$entity->field_annonce; | |
field_attach_update('node',$entity2); | |
$entity = node_load(33); | |
echo "after save: {$entity->field_test1[LANGUAGE_NONE][0]['value']}<br/>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment