Get related content from a model

I'm upgrading a plugin from Omeka 1 to 2 compatability. I'm not super familiar with Omeka and I'm trying to create a dropdown list of my collections. Is there a way to get related content, as collection name appears to be in Omeka_Elements_Text table, or do I need to write a join? In Django you just keep chaining your model names together until you get the field you want? Here's what I have so far?

<select id="item_type">
                            <option id="">--Select Type--</option>
                        $item_types = get_records('ItemType', array(), -1);
                        set_loop_records('types', $item_types);
                        foreach(loop('types') as $type): ?>
                           <option id="<?php echo $type->id; ?>"><?php echo $type->name ?></option>
                  <?php endforeach; ?>

You're trying to get a select for Collections, or Item Types?

Omeka already has a function for getting the label-value pairs for making a <select> for Collections, Item Types, and many other records.

get_table_options('ItemType') would return you an array of Item Type IDs associated with their names. That array can be directly used with Zend's formSelect helper, or iterated through manually if you prefer to create the <option> elements yourself.

For Collections, you would just use the same function but with Collection as the argument.

Thanks John,

Sorry I was trying to do both and mixed my examples up a bit. get_table_options did the trick.