You are previewing Programming Drupal 7 Entities.

Programming Drupal 7 Entities

Cover of Programming Drupal 7 Entities by Sammy Spets Published by Packt Publishing
  1. Programming Drupal 7 Entities
    1. Table of Contents
    2. Programming Drupal 7 entities
    3. Credits
    4. About the Author
    5. Acknowledgement
    6. About the Reviewers
      1. Support files, eBooks, discount offers and more
    8. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Using the example code
      5. Conventions
      6. Reader feedback
      7. Customer support
    9. 1. Understanding Entities
      1. Introducing entities
      2. Entity and solution modules
      3. Introducing entity types, bundles, and fields
      4. Powerful entity use cases
      5. Our use case
      6. Summary
    10. 2. Developing with Entity Metadata Wrappers
      1. Introducing entity metadata wrappers
      2. Creating an entity metadata wrapper object
      3. Standard entity properties
      4. Entity introspection
      5. Using an entity metadata wrapper
      6. Safely using text property values
      7. Self-imposed limitation of entity programming
      8. References
      9. A note about EntityFieldQuery
      10. Summary
    11. 3. Developing with Non-fieldable Entities
      1. What are non-fieldable entities?
      2. File entities
      3. Vocabulary entities
      4. Recipe site vocabularies
      5. Summary
    12. 4. Developing with Fieldable Entities
      1. What are fieldable entities?
      2. Node entities
      3. Comment entities
      4. Term entities
      5. Summary
    13. 5. Developing with Fields
      1. Field types
      2. Single-value and multi-value fields
      3. Structure fields
      4. Converting the recipe content type to use fields
      5. Summary
    14. 6. Developing with Field Collections
      1. Before Drupal 7
      2. Creating a field collection field
      3. Field collection entities
      4. Adding a field collection to a node
      5. Attaching a field collection to a content type
      6. Summary
    15. 7. Expose Local Entities
      1. Motivation for exposing entities
      2. Fast track your data exposure
      3. Allow fields on your entity
      4. Give it multiple bundles
      5. Administration interface and exportability
      6. Summary
    16. 8. Expose Remote Entities
      1. Introducing the Remote Entity API
      2. Requirements for exposing remote entities
      3. Implementing remote entity exposure
      4. Running
      5. Adding write support
      6. Customization for your use case
      7. Summary
    17. Index

Term entities

Similar to the vocabulary entities, terms have a special type name: taxonomy_term. The properties of taxonomy_term entities are shown in the following table:

Wrapper property

Type (Read/Write)


Entity property


integer (R)

Term ID



string (R/W)




string (R/W)




integer (R/W)

Weight; value for the order of terms



integer (R)

Number of nodes tagged with the term



uri/string (R)




taxonomy_vocabulary/integer (R/W)




list<taxonomy_term> (R/W)

Parent terms



list<taxonomy_term> (R/W)

Ancestor terms


Properties of taxonomy_term entities are quite straightforward. ...

The best content for your career. Discover unlimited learning on demand for around $1/day.