What names are given to a new parent

@param string $child_name A GEDCOM NAME
@param string $parent_sex M, F or U

@return string[] Associative array of GEDCOM name parts (SURN, _MARNM, etc.)
963592
public function newParentNames(string $child_name, string $parent_sex): array
    {
        if ($parent_sex === 'M' && preg_match(self::REGEX_SPFX_SURN, $child_name, $match)) {
            return array_filter([
                'NAME' => $match['NAME'],
                'SPFX' => $match['SPFX'],
                'SURN' => $match['SURN'],
            ]);
        }

        return [
            'NAME' => '//',
        ];
    }
1024716
public function getAllChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()->where(['parent_id' => $parent_id])->all();
        return $children;
    }
172892
public function findRelatedEntries($entry_id, $parent_field_id)
    {
        // We have the entry_id of the entry that has the referenced tag values
        // Lets find out what those handles are so we can then referenced the
        // child section looking for them.
        $handles = Symphony::Database()->fetchCol('handle', sprintf("
            SELECT `handle`
            FROM `tbl_entries_data_%d`
            WHERE `entry_id` = %d
        ", $parent_field_id, $entry_id));

        $ids = Symphony::Database()->fetchCol('entry_id', sprintf("
            SELECT `entry_id`
            FROM `tbl_entries_data_%d`
            WHERE `handle` IN ('%s')
        ", $this->get('id'), implode("','", $handles)));

        return $ids;
    }
948135
public function buildTree($data, $row_level = 'parent')
    {
        $new = [];
        foreach ($data as $a) {
            if (null === $a->{$row_level}) {
                $a->{$row_level} = 0;
            }
            $new[$a->{$row_level}][] = $a;
        }

        return $this->createTree($new, Arr::get($new, 0, []));
    }
954770
private function birthAndDeathQuery(string $sex): Builder
    {
        $query = DB::table('individuals')
            ->where('i_file', '=', $this->tree->id())
            ->join('dates AS birth', static function (JoinClause $join): void {
                $join
                    ->on('birth.d_file', '=', 'i_file')
                    ->on('birth.d_gid', '=', 'i_id');
            })
            ->join('dates AS death', static function (JoinClause $join): void {
                $join
                    ->on('death.d_file', '=', 'i_file')
                    ->on('death.d_gid', '=', 'i_id');
            })
            ->where('birth.d_fact', '=', 'BIRT')
            ->where('death.d_fact', '=', 'DEAT')
            ->whereColumn('death.d_julianday1', '>=', 'birth.d_julianday2')
            ->where('birth.d_julianday2', '<>', 0);

        if ($sex === 'M' || $sex === 'F') {
            $query->where('i_sex', '=', $sex);
        }

        return $query;
    }
1336491
public function getChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()
            ->where(['parent_id' => $parent_id, 'show' => true])
            ->orderBy(['position' => SORT_ASC])
            ->all();
        return $children;
    }
548118
private function allAncestors($xref1, $xref2, $tree_id): array
    {
        $ancestors = [
            $xref1,
            $xref2,
        ];

        $queue = [
            $xref1,
            $xref2,
        ];
        while (!empty($queue)) {
            $parents = DB::table('link AS l1')
                ->join('link AS l2', static function (JoinClause $join): void {
                    $join
                        ->on('l1.l_to', '=', 'l2.l_to')
                        ->on('l1.l_file', '=', 'l2.l_file');
                })
                ->where('l1.l_file', '=', $tree_id)
                ->where('l1.l_type', '=', 'FAMC')
                ->where('l2.l_type', '=', 'FAMS')
                ->whereIn('l1.l_from', $queue)
                ->pluck('l2.l_from');

            $queue = [];
            foreach ($parents as $parent) {
                if (!in_array($parent, $ancestors, true)) {
                    $ancestors[] = $parent;
                    $queue[]     = $parent;
                }
            }
        }

        return $ancestors;
    }
305922
def get_parents_for(self, child_ids):
        
        self._cache_init()
        parent_candidates = []
        for parent, children in self._cache_get_entry(self.CACHE_NAME_PARENTS).items():
            if set(children).intersection(child_ids):
                parent_candidates.append(parent)
        return set(parent_candidates)
267389
public function findChildrenTreeByParentId($parent_id)
    {
        $qb = $this->createQueryBuilder();

        $qb = $this->alterQueryBuilderWithParentRoot($qb, $parent_id);

        $qb->orderBy($qb->getRootAliases()[0] . '.lft', 'ASC');

        return $this->getResultFromQueryBuilder($qb);
    }
50264
public function findSubtypes($parentTypeName)
    {
        $this->stringHelper->validate($parentTypeName);

        $symbols = [];

        foreach ($this->symbols as $symbol) {
            if (is_a($symbol, $parentTypeName)) {
                $symbols[] = $symbol;
            }
        }

        return $symbols;
    }
1084505
function group_add_group($parent,$child){

        //find the parent group's dn
        $parent_group=$this->group_info($parent,array("cn"));
        if ($parent_group[0]["dn"]==NULL){ return (false); }
        $parent_dn=$parent_group[0]["dn"];
        
        //find the child group's dn
        $child_group=$this->group_info($child,array("cn"));
        if ($child_group[0]["dn"]==NULL){ return (false); }
        $child_dn=$child_group[0]["dn"];
                
        $add=array();
        $add["member"] = $child_dn;
        
        $result=@ldap_mod_add($this->_conn,$parent_dn,$add);
        if ($result==false){ return (false); }
        return (true);
    }
1108662
public function children($name = null)
    {
        if (!$name) {
            return $this->getStructures();
        }

        $result = [];
        foreach ($this->getStructures() as $childStructure) {
            if ($childStructure->getParentName() === $name) {
                $result[] = $childStructure;
            } else {
                $localResult = $childStructure->children($name);
                if ($localResult) {
                    $result = array_merge($result, $localResult);
                }
            }
        }

        if (!count($result)) {
            return null;
        }

        return $result;
    }
1202551
public function getChildOrganizations($parentId = null)
    {
        static $children;

        if (is_null($parentId)) {
            return array();
        }

        if (! isset($children[$parentId])) {
            $organizations = $this->db->fetchPairs(
                    'SELECT gor_id_organization, gor_name
                        FROM gems__organizations
                        WHERE gor_active=1 AND gor_has_login=1 AND
                            (gor_accessible_by LIKE ' . $this->db->quote('%:' . $parentId . ':%') . ' OR
                                gor_id_organization = ' . $this->db->quote($parentId) .  ')
                            ORDER BY gor_name');

            natsort($organizations);

            $children[$parentId] = $organizations;
        }

        return $children[$parentId];
    }
70671
public function newChildNames(string $father_name, string $mother_name, string $child_sex): array
    {
        if (preg_match(self::REGEX_SURN, $father_name, $match)) {
            if ($child_sex === 'F') {
                return array_filter([
                    'NAME' => $this->inflect($match['NAME'], self::INFLECT_DAUGHTER),
                    'SURN' => $this->inflect($match['SURN'], self::INFLECT_MALE),
                ]);
            }

            return array_filter([
                'NAME' => $match['NAME'],
                'SURN' => $match['SURN'],
            ]);
        }

        return [
            'NAME' => '//',
        ];
    }
1346567
private function getAllChildKeys($data, $maps, $parent_keys, $parent_types, & $result, & $keys, $current_key = [], $current_type = null) {
		if ($current_type == '11') {
			$data = ['__11__' => $data];
		}
		foreach ($data as $k => $v) {
			$new_key = $current_key;
			if ($current_type != '11') {
				$new_key[] = $k;
			}
			if (count($parent_keys) == 1) {
				$new_key[] = $parent_keys[0];
				// put values into result
				$result[] = $new_key;
				// generate keys
				$temp = [];
				foreach ($maps[0] as $k3 => $v3) {
					$temp[] = $v[$k3];
				}
				// we need to preserve a data type if its just one column key
				if (count($temp) == 1) {
					$keys[] = $temp[0];
				} else {
					$keys[] = implode('::', $temp);
				}
			} else {
				// remove extra level
				$parent_keys_temp = $parent_keys;
				$v2 = array_shift($parent_keys_temp);
				$parent_types_temp = $parent_types;
				array_shift($parent_types_temp);
				$maps_temp = $maps;
				array_shift($maps_temp);
				// generate key
				$new_key[] = $v2;
				$this->getAllChildKeys($v[$v2], $maps_temp, $parent_keys_temp, $parent_types_temp, $result, $keys, $new_key, $parent_types[0]);
			}
		}
	}
386484
protected function _parseParent($child, $data, $attributes) {
        $parent = $child->xpath("parent::*");

        if (is_object($parent[0]['name'])) {
            foreach ($attributes as $attribute) {
                $name = $attribute['name'];

                if (is_object($parent[0][$name])) {
                    /** @var SimpleXMLElement $element */
                    $element = $parent[0][$name];

                    if ($attribute['concatenate'] == true) {
                        if ($data[$name] != '') {
                            $data[$name] = $element->__toString() . $attribute['separator'] . $data[$name];
                        }
                        else {
                            $data[$name] = $element->__toString();
                        }
                    }
                    else {
                        if ($data[$name] == '') {
                            $data[$name] = $element->__toString();
                        }
                    }
                }
            }

            $data = $this->_parseParent($parent[0], $data, $attributes);
        }

        return $data;
    }
1030765
public static List<Element> getChildren(Element parent, String childName) {
		ArrayList<Element> children = new ArrayList<Element>();
		NodeList nodes = parent.getChildNodes();
		for (int i = 0; i < nodes.getLength(); ++i) {
			Node node = nodes.item(i);
			if ((node instanceof Element) && node.getNodeName().equals(childName))
				children.add((Element)node);
		}
		return children;
	}