[Midas] item's parent info

Zach Mullen zach.mullen at kitware.com
Thu Jul 5 16:44:40 EDT 2012


The dao classes have auto-generated getter methods for each of their data
properties.  So to get the item id, you would call:

$itemId = $item->getItemId();

Items are actually allowed to be simultaneously in multiple folders
(although that is uncommon), and the way to get all of the parent folders
of an item is to call:

$folders = $item->getFolders();

It will return a list of folder daos representing all of the folders in
which the item resides.

Thanks,

Zach

On Thu, Jul 5, 2012 at 4:38 PM, Mona Wong <mona at sdsc.edu> wrote:

>
> In my controller, I have the itemid and I'd like to know the directory
> which contains that item, how do I get that info?
>
> I tried "$this->Item->load ( $itemid )" but that doesn't contain the info
> I needed:
>
> item = object(ItemDao)#134 (17) { ["_model"]=> string(4) "Item"
> ["key":protected]=> NULL ["ModelLoader"]=> object(MIDAS_ModelLoader)#130
> (0) { } ["_key"]=> string(7) "item_id" ["saved"]=> bool(true) ["item_id"]=>
> string(5) "18876" ["name"]=> string(9) "annio.xml" ["description"]=>
> string(0) "" ["type"]=> string(1) "0" ["sizebytes"]=> string(4) "1192"
> ["date_creation"]=> string(19) "2012-06-29 19:50:19" ["date_update"]=>
> string(19) "2012-07-02 16:10:01" ["thumbnail"]=> string(0) "" ["view"]=>
> string(2) "18" ["download"]=> string(2) "11" ["privacy_status"]=> string(1)
> "1" ["uuid"]=> string(45) "<scrubbed>" } ]
>
> Mona
>
>      *********************************************
>     Mona Wong
>     Web & iPad Application Developer
>     San Diego Supercomputer Center
>
>     Believing we are in control is an
>     illusion that brings suffering.
> *********************************************
>
>
>
>
>
>
> _______________________________________________
> Midas mailing list
> Midas at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/midas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20120705/4404a90d/attachment.html>


More information about the Midas mailing list