How to add Properties to an Entity in code? With Drupal (v7.22) I'm using the Entity Construction Kit (ECK) module (v7.x-2.0-rc2) and want to extend the sub module called 'ECK Example' that comes with it. Currently the example module just creates an Entity using code but doesn't include any default properties like Title, Author, Changed etc. This is the current module code:

$entity_type = new EntityType();
$entity_type-&gt;name = "eck_employee";
$entity_type-&gt;label = "Employee";
$entity_type-&gt;addProperty('name', 'Name', 'text');
$entity_type-&gt;save();


How can I enable the default properties for the Entity?
I've been researching and playing around with the ECK module all day and have managed to answer my own question. Hopefully someone else will find this helpful.

To the example code listed just add these lines before the save() function is called:

$entity_type-&gt;addProperty('title', 'Title', 'text', 'title');
$entity_type-&gt;addProperty('uid', 'Author', 'integer', 'author');
$entity_type-&gt;addProperty('created', 'Created', 'integer', 'created');
$entity_type-&gt;addProperty('changed', 'Changed', 'integer', 'changed');