The attached plugin provides support for all entities relying on the Entity API (Commerce, Organic Groups, a bunch of contrib modules around them.).
It detects the primary key, and available fields (by using Entity Metadata).
Used in a couple of Commerce Guys projects at the moment, so it's pretty in good shape.

CommentFileSizeAuthor
entity_api.inc_.txt5.76 KBbojanz

Comments

bojanz’s picture

Note that I'm maintaining a version of this code in commerce_migrate. It's more recent than what I posted here.
Maybe the code should go into Entity API itself?

laurentchardin’s picture

subscribe

marcusx’s picture

Can you provide some example code how to use this likely very amazig plugin!? I would like to use it for importing data into a field collection, which is an entity and should for this reason have the prerequisits to be importet with your entity_api plugin. See therefore also this question I filed in the migrate issues #1167522: Howto import data into a field collection? Aka import data into entity inside a node?.

Thank you!
regards
marcus

bojanz’s picture

Status: Needs review » Closed (won't fix)

I can't comment because I don't know how field collection is written and structured.

Marking this issue as won't fix because I think the class should live in the Entity API itself. Will roll a new patch there using the latest code from Commerce Migrate.
EDIT: Here it is, for reference: #1168196: Add generic-entity integration.

rfay’s picture

@marcusx Just noticed your request. Commerce Migrate has lots of uses of this.