Create permanent owner_id column in the item table, and use a soft

relationship to bind the two.  To do this, I overrode __get in
Item_Model so that $item->owner returns the appropriate User_Model.
This commit is contained in:
Bharat Mediratta
2008-11-08 07:48:36 +00:00
parent ea7cc4f46e
commit 418c0aab69
7 changed files with 42 additions and 18 deletions
+7 -5
View File
@@ -2,21 +2,23 @@
<table class="gMetadata">
<tbody>
<tr>
<th>Title:</th>
<th><?= _("Title:") ?></th>
<td><?= $item->title; ?></td>
</tr>
<tr>
<th>Description:</th>
<th><?= _("Description:") ?></th>
<td><?= $item->description; ?></td>
</tr>
<tr>
<th>Name:</th>
<th><?= _("Name:") ?></th>
<td><?= $item->name; ?></td>
</tr>
<? if ($item->owner): ?>
<tr>
<th>Owner:</th>
<td><a href="#"><?= isset($item->user_id) ? $item->user->name : "anonymous"?></a></td>
<th><?= _("Owner:") ?></th>
<td><a href="#"><?= $item->owner->name ?></a></td>
</tr>
<? endif ?>
<tr>
<td colspan="2" class="toggle">
<a href="#">more \/</a>