/** * Get all the relations moduleId-itemId that are for the current user. * * @param integer $moduleId The module ID to get. * @param integer $itemId The item ID. * * @return array Array with tag-user Ids. */ public function getRelationIdByModule($moduleId, $itemId) { // Found all the relations moduleId-itemId <-> userId-tagId $moduleUserTagRelation = $this->_tagsModules->getRelationIdByModule($moduleId, $itemId); // Select only the relation with the current user $tagUserRelations = array(); foreach ($moduleUserTagRelation as $tagUserId) { if ($this->_tagsUsers->isFromUser($tagUserId)) { $tagUserRelations[] = $tagUserId; } } return $tagUserRelations; }