tripal_entities.api.inc 734 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Deletes a tripal_entity.
  4. */
  5. function tripal_entity_delete(TripalEntity $tripal_entity) {
  6. $tripal_entity->delete();
  7. }
  8. /**
  9. * Saves a tripal_entity to the database.
  10. *
  11. * @param $tripal_entity
  12. * The tripal_entity object.
  13. */
  14. function tripal_entity_save(TripalEntity $entity) {
  15. return $entity->save();
  16. }
  17. /**
  18. * Saves a tripal_entity type to the db.
  19. */
  20. function tripal_bundle_save(TripalBundle $entity) {
  21. $entity->save();
  22. }
  23. /**
  24. * Deletes a tripal_entity type from the db.
  25. */
  26. function tripal_bundle_delete(TripalBundle $type) {
  27. $type->delete();
  28. }
  29. /**
  30. * URI callback for tripal_entitys
  31. */
  32. function tripal_entity_uri(TripalEntity $entity){
  33. return array(
  34. 'path' => 'data/' . $entity->id,
  35. );
  36. }