Drupal Association members fund grants that make connections all over the world.
Presuming you have the Entity API module installed, let's say you created an entity type called "Contact" [contact] and a bundle called 'contact_simple'.
Creating new entities is easy as:
$entity_type = 'contact'; $entity = entity_create($entity_type, array('type' => 'contact_simple')); $wrapper = entity_metadata_wrapper($entity_type, $entity);
Once the entity is created you can change its properties:
$wrapper->uid = 9;
And any attached field:
Alternatively, you can set field values directly as the EntityMetadataWrapper class (provided by EntityAPI) implements PHP's magic __set() method. For example:
$wrapper->field_full_name = "John doe";
That's it. Just remember save it: