Jump to content

How to use getItemsWithPermission() with extra joins?

Go to solution Solved by KT Walrus,

Recommended Posts

My app uses a map table for mapping containers to items. I'm trying to implement having an item be contained in multiple containers.

I've got this mostly working by adding an INNER join of the map table when calling getItemsWithPermission(). 

But, I now want to select other columns in the joined map table and on return from getItemsWithPermission(), I want to access the joined map table column data within my Item Class.

How do I access the map.* column data?

$joins[ 'map' ] = array(
   'select' => 'map.*',
   'from'   => array( 'myapp_forum_topic_map', 'map' ),
   'where'  => array( 'myapp_topics.tid=map.topic_id AND ' . \IPS\Db::i()->in( 'map.forum_id', array_filter( $forumIds ) ) ),
   'type'   => 'INNER'

return parent::getItemsWithPermission( $where, $order, $limit, $permissionKey, $includeHiddenItems, $queryFlags, $member, $joinContainer, $joinComments, $joinReviews, $countOnly, $joins, $skipPermission, $joinTags, $joinAuthor, $joinLastCommenter, $showMovedLinks );
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...