Example #1
0
 /**
  * Get all tags associated to a list of tasks
  *
  * @access public
  * @param  integer[] $task_ids
  * @return array
  */
 public function getTagsByTasks($task_ids)
 {
     if (empty($task_ids)) {
         return array();
     }
     $tags = $this->db->table(TagModel::TABLE)->columns(TagModel::TABLE . '.id', TagModel::TABLE . '.name', self::TABLE . '.task_id')->in(self::TABLE . '.task_id', $task_ids)->join(self::TABLE, 'tag_id', 'id')->findAll();
     return array_column_index($tags, 'task_id');
 }
Example #2
0
 /**
  * Get all project roles with restrictions
  *
  * @param  int $project_id
  * @return array
  */
 public function getAllWithRestrictions($project_id)
 {
     $roles = $this->getAll($project_id);
     $column_restrictions = $this->columnRestrictionModel->getAll($project_id);
     $column_restrictions = array_column_index($column_restrictions, 'role_id');
     array_merge_relation($roles, $column_restrictions, 'column_restrictions', 'role_id');
     $column_move_restrictions = $this->columnMoveRestrictionModel->getAll($project_id);
     $column_move_restrictions = array_column_index($column_move_restrictions, 'role_id');
     array_merge_relation($roles, $column_move_restrictions, 'column_move_restrictions', 'role_id');
     $project_restrictions = $this->projectRoleRestrictionModel->getAll($project_id);
     $project_restrictions = array_column_index($project_restrictions, 'role_id');
     array_merge_relation($roles, $project_restrictions, 'project_restrictions', 'role_id');
     return $roles;
 }