Return the list of all sosas, with the generations it belongs to

@return array Associative array of Sosa ancestors, with their generation, comma separated
481561
public function getAllSosaWithGenerations(){
        if(!$this->is_setup) return array();
        return Database::prepare(
            'SELECT majs_i_id AS indi,' .
            ' GROUP_CONCAT(DISTINCT majs_gen ORDER BY majs_gen ASC SEPARATOR ",") AS generations' .
            ' FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id' .
            ' GROUP BY majs_i_id'
        )->execute(array(
            'tree_id' => $this->tree->getTreeId(),
            'user_id' => $this->user->getUserId()
        ))->fetchAssoc();
    }
176884
public function getAncestors()
    {
        $ancestors = new Collection();

        $ancestor = $this;

        while (($ancestor = $ancestor->parent) && !$ancestors->contains($ancestor)) {
            $ancestors->push($ancestor);
            break;
        }

        return $ancestors;
    }
37566
def descendants(include_singletons = false)
      return _inherited_by.map { |c| [c, c.descendants] }.flatten.uniq if BBLib.in_opal?
      ObjectSpace.each_object(Class).select do |c|
        (include_singletons || !c.singleton_class?) && c < self
      end
    end
84989
public function getOldRelations()
    {
        $oldRelations = [];
        foreach ($this->_relations as $relationName) {
            $oldRelations[$relationName] = $this->getOldRelation($relationName);
        }
        return $oldRelations;
    }
479351
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->family)) {
            $result['family'] = $this->family->toArray();
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->edition)) {
            $result['edition'] = $this->edition;
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
1326693
public function getAncestors($class)
    {
        $ancestors = [];
        while (true) {
            $parent = $this->getParent($class);
            if ($parent) {
                $ancestors[] = $parent;
                $class = $parent;
            } else {
                break;
            }
        }
        return $ancestors;
    }
1077863
public function getDescendantGroups() {
    if (!isset($this->descendantGroups)) {
      $this->descendantGroups = [];
      if (isset($this->group)) {
        $this->descendantGroups =
          (array) $this->group->getDescendants();
      }
      foreach ($this->groups as $curGroup) {
        $this->descendantGroups =
          array_merge(
              (array) $this->descendantGroups,
              (array) $curGroup->getDescendants()
          );
      }
    }
    return $this->descendantGroups;
  }
163230
protected function getChildrenList() {
        $query = (new Query)->from($this->itemChildTable);
        $parents = [];
        foreach ($query->all($this->db) as $row) {
            $parents[$row['parent']][] = $row['child'];
        }
        return $parents;
    }
1193709
private function htmlAncestorDispersionG2()
    {
        $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2);
        if(count($ancestorsDispGen2) == 0) return;
        
        $size = '600x300';
        
        $total = array_sum($ancestorsDispGen2);
        $father_count = array_key_exists(1, $ancestorsDispGen2) ? $ancestorsDispGen2[1] : 0;
        $father = array (
            'color' => '84beff', 
            'count' => $father_count, 
            'perc' => Functions::safeDivision($father_count, $total), 
            'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat')            
        );
        $mother_count = array_key_exists(2, $ancestorsDispGen2) ? $ancestorsDispGen2[2] : 0;
        $mother = array (
            'color' => 'ffd1dc', 
            'count' => $mother_count, 
            'perc' => Functions::safeDivision($mother_count, $total),
            'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot')
        );
        $shared_count = array_key_exists(-1, $ancestorsDispGen2) ? $ancestorsDispGen2[-1] : 0;
        $shared = array (
            'color' => '777777', 
            'count' => $shared_count, 
            'perc' => Functions::safeDivision($shared_count, $total),
            'name' => I18N::translate('Shared')
        );
        
        $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc']));
        $chart_title = I18N::translate('Known Sosa ancestors\' dispersion');
        $chl = 
             $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' .
             $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' .
             $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1);
        return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$father['color']},{$shared['color']},{$mother['color']}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
    }
1214916
public function getAllCategoryTreesAsArray()
    {
        $rootIds = $this->getAllRootIds();

        $trees = array();
        foreach ($rootIds as $rootId) {
            $trees[$rootId] = $this->getCategoryTreeAsArray($rootId);
        }

        return $trees;
    }
1109310
public function getParents()
    {
        $parents = [];
        if ($this->parent && !$this->parent instanceof Root) {
            $parents = $this->parent->getParents();
            $parents[] = $this->parent;
        }

        return $parents;
    }
1287615
public function getAllParents()
    {
        $closestParents = $this->getParents();

        $allParents = [];

        foreach ($closestParents as $parent) {
            $allParents = array_merge(
                $allParents,
                $parent->getAllParents()
            );
        }

        $allParents = array_unique(
            array_merge(
                $allParents,
                $closestParents->toArray()
            )
        );

        return $allParents;
    }
870211
public function getCollectionParentIDs()
    {
        $cIDs = array($this->cParentID);
        $db = Database::connection();
        $aliasedParents = $db->fetchAll('SELECT cParentID FROM Pages WHERE cPointerID = ?', array($this->cID));
        foreach ($aliasedParents as $aliasedParent) {
            $cIDs[] = $aliasedParent['cParentID'];
        }

        return $cIDs;
    }
1142670
public static function allDescriptions(): array
    {
        return [
            'paternal'     => I18N::translateContext('Surname tradition', 'paternal') . ' — ' .
                /* I18N: In the paternal surname tradition, ... */
                I18N::translate('Children take their father’s surname.') . ' ' .
                /* I18N: In the paternal surname tradition, ... */
                I18N::translate('Wives take their husband’s surname.'),
            'patrilineal ' =>
                /* I18N: A system where children take their father’s surname */
                I18N::translate('patrilineal') . ' — ' .
                /* I18N: In the patrilineal surname tradition, ... */
                I18N::translate('Children take their father’s surname.'),
            'matrilineal ' => /* I18N: A system where children take their mother’s surname */
                I18N::translate('matrilineal') . ' — ' .
                /* I18N: In the matrilineal surname tradition, ... */
                I18N::translate('Children take their mother’s surname.'),
            'spanish'      => I18N::translateContext('Surname tradition', 'Spanish') . ' — ' .
                /* I18N: In the Spanish surname tradition, ... */
                I18N::translate('Children take one surname from the father and one surname from the mother.'),
            'portuguese'   => I18N::translateContext('Surname tradition', 'Portuguese') . ' — ' .
                /* I18N: In the Portuguese surname tradition, ... */
                I18N::translate('Children take one surname from the mother and one surname from the father.'),
            'icelandic'    => I18N::translateContext('Surname tradition', 'Icelandic') . ' — ' .
                /* I18N: In the Icelandic surname tradition, ... */
                I18N::translate('Children take a patronym instead of a surname.'),
            'polish'       => I18N::translateContext('Surname tradition', 'Polish') . ' — ' .
                /* I18N: In the Polish surname tradition, ... */
                I18N::translate('Children take their father’s surname.') . ' ' .
                /* I18N: In the Polish surname tradition, ... */
                I18N::translate('Wives take their husband’s surname.') . ' ' .
                /* I18N: In the Polish surname tradition, ... */
                I18N::translate('Surnames are inflected to indicate an individual’s gender.'),
            'lithuanian'   => I18N::translateContext('Surname tradition', 'Lithuanian') . ' — ' .
                /* I18N: In the Lithuanian surname tradition, ... */
                I18N::translate('Children take their father’s surname.') . ' ' .
                /* I18N: In the Lithuanian surname tradition, ... */
                I18N::translate('Wives take their husband’s surname.') . ' ' .
                /* I18N: In the Lithuanian surname tradition, ... */
                I18N::translate('Surnames are inflected to indicate an individual’s gender and marital status.'),
            'none'         => I18N::translateContext('Surname tradition', 'none'),
        ];
    }
161041
public function getListParent()
    {
        $parent = session()->get($this->getSessionKey(static::TYPE_PARENT));

        if (null === $parent) {
            return null;
        }

        if (static::PARENT_DISABLE === $parent) {
            return false;
        }

        list($relation, $key) = explode(':', $parent, 2);

        return compact('relation', 'key');
    }
417298
public function toArray()
	{
		$list = parent::toArray();

		$list[$this->_prefix . 'parentid'] = $this->getParentId();
		$list[$this->_prefix . 'typeid'] = $this->getTypeId();
		$list[$this->_prefix . 'type'] = $this->getType();
		$list[$this->_prefix . 'domain'] = $this->getDomain();
		$list[$this->_prefix . 'refid'] = $this->getRefId();
		$list[$this->_prefix . 'datestart'] = $this->getDateStart();
		$list[$this->_prefix . 'dateend'] = $this->getDateEnd();
		$list[$this->_prefix . 'config'] = $this->getConfig();
		$list[$this->_prefix . 'position'] = $this->getPosition();
		$list[$this->_prefix . 'status'] = $this->getStatus();

		return $list;
	}
424492
public function getAncestors($includeSelf = false)
    {
        $ancestors = new ArrayList();
        $object = $this->owner;

        if ($includeSelf) {
            $ancestors->push($object);
        }
        while ($object = $object->getParent()) {
            $ancestors->push($object);
        }

        return $ancestors;
    }