Skip to content
mikert edited this page Feb 24, 2011 · 1 revision

Object-Asset Table Reference

Associated Perl class

  • MT::ObjectAsset

Purpose

This object serves as a look up table for object-asset mappings.

Fields

  • objectasset_id - integer not null auto_increment - The primary key.
  • objectasset_blog_id - integer - The blog where the association has been made.
  • objectasset_object_id - integer not null - The ID of the object associated with a particular asset.
  • objectasset_object_ds - string(50) not null - The data source of the object in the association. This is the name of the object's table, minus the "mt_" prefix.
  • objectasset_asset_id - integer not null - The ID of the asset in the association.
  • objectasset_embedded - boolean - A boolean flag which shows whether or not this asset has been embedded into the object. Mainly used with entries and pages.

Indexes

  • mt_objectasset_blog_obj - columns:
    • objectasset_blog_id
    • objectasset_object_ds
    • objectasset_object_id
  • mt_objectasset_id_ds - columns:
    • objectasset_object_id
    • objectasset_object_ds
  • mt_objectasset_asset_id

SQL Example

SELECT
    entry_title, asset_label
FROM
    mt_entry e
JOIN
    mt_objectasset oa
ON
    e.entry_id = oa.objectasset_object_id
AND
    oa.objectasset_object_ds = 'entry'
JOIN
    mt_asset a
ON
    a.asset_id = oa.objectasset_asset_id
Clone this wiki locally