Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * Index a string with the moduleId and the itemId.
  *
  * The function get a string and separate into many words and store each of them.
  *
  * @param integer $moduleId The module ID to store.
  * @param integer $itemId   The item ID.
  * @param string  $data     String to save.
  *
  * @return void
  */
 private function _index($moduleId, $itemId, $data)
 {
     $tags = $this->_stringToArray($data);
     $this->_tagsTableMapper->saveTagsForModuleItem($moduleId, $itemId, $tags);
 }