_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q20700
FamilyRepository.totalChildren
train
public function totalChildren(): string { $total = (int) DB::table('families') ->where('f_file', '=', $this->tree->id())
php
{ "resource": "" }
q20701
FamilyRepository.averageChildren
train
public function averageChildren(): string { $average = (float) DB::table('families') ->where('f_file', '=', $this->tree->id())
php
{ "resource": "" }
q20702
FamilyRepository.topTenFamilyQuery
train
private function topTenFamilyQuery(int $total): array { return DB::table('families') ->where('f_file', '=', $this->tree->id()) ->orderBy('f_numchil', 'DESC') ->limit($total) ->get() ->map(Family::rowMapper()) ->filter(GedcomRecord::acce...
php
{ "resource": "" }
q20703
FamilyRepository.topTenLargestFamily
train
public function topTenLargestFamily(int $total = 10): string { $records = $this->topTenFamilyQuery($total);
php
{ "resource": "" }
q20704
FamilyRepository.topTenLargestFamilyList
train
public function topTenLargestFamilyList(int $total = 10): string { $records = $this->topTenFamilyQuery($total);
php
{ "resource": "" }
q20705
FamilyRepository.totalMarriedMales
train
public function totalMarriedMales(): string { $n = (int) DB::table('families') ->where('f_file', '=', $this->tree->id()) ->where('f_gedcom', 'LIKE', "%\n1 MARR%")
php
{ "resource": "" }
q20706
FamilyRepository.ageBetweenSpousesQuery
train
private function ageBetweenSpousesQuery(string $age_dir, int $total): array { $prefix = DB::connection()->getTablePrefix(); $query = DB::table('families') ->where('f_file', '=', $this->tree->id()) ->join('dates AS wife', static function (JoinClause $join): void { ...
php
{ "resource": "" }
q20707
FamilyRepository.statsDiv
train
public function statsDiv(string $color_from = null, string $color_to = null): string
php
{ "resource": "" }
q20708
Menu.bootstrap4
train
public function bootstrap4(): string { if (!empty($this->submenus)) { $submenus = ''; foreach ($this->submenus as $submenu) { $attrs = ''; foreach ($submenu->attrs as $key => $value) { $attrs .= ' ' . $key . '="' . e($value) . '"'; ...
php
{ "resource": "" }
q20709
LifespansChartModule.chartUrl
train
public function chartUrl(Individual $individual, array $parameters = []): string { return route('module', [ 'module' => $this->name(), 'action' => 'Chart',
php
{ "resource": "" }
q20710
LifespansChartModule.maxYear
train
protected function maxYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual $item) {
php
{ "resource": "" }
q20711
LifespansChartModule.minYear
train
protected function minYear(array $individuals): int { $jd = array_reduce($individuals, static function ($carry, Individual
php
{ "resource": "" }
q20712
LifespansChartModule.jdToYear
train
protected function jdToYear(int $jd): int { if ($jd === 0) { return 0; }
php
{ "resource": "" }
q20713
LifespansChartModule.closeFamily
train
protected function closeFamily(Individual $individual): array { $xrefs = []; foreach ($individual->spouseFamilies() as $family) { foreach ($family->children() as $child) { $xrefs[] = $child->xref(); } foreach ($family->spouses() as $spouse) { ...
php
{ "resource": "" }
q20714
LifespansChartModule.subtitle
train
protected function subtitle(int $count, Date $start, Date $end, string $placename): string { if ($start->isOK() && $end->isOK() && $placename !== '') { return I18N::plural( '%s individual with events in %s between %s and %s', '%s individuals with events in %s betw...
php
{ "resource": "" }
q20715
RegisterController.registerPage
train
public function registerPage(ServerRequestInterface $request): ResponseInterface { $this->checkRegistrationAllowed(); $comments = $request->get('comments', ''); $email = $request->get('email', ''); $realname = $request->get('realname', ''); $username = $request->get('user...
php
{ "resource": "" }
q20716
RegisterController.verifyPage
train
public function verifyPage(): ResponseInterface { $this->checkRegistrationAllowed();
php
{ "resource": "" }
q20717
GedcomCodeTemp.templeNames
train
public static function templeNames(): array { $temple_names = []; foreach (self::templeCodes() as $temple_code) {
php
{ "resource": "" }
q20718
Age.asText
train
public function asText(): string { if ($this->keyword === self::KEYWORD_STILLBORN) { // I18N: An individual’s age at an event. e.g. Died 14 Jan 1900 (stillborn) return I18N::translate('(stillborn)'); } if ($this->keyword === self::KEYWORD_INFANT) { // I18...
php
{ "resource": "" }
q20719
ReportPdfLine.render
train
public function render($renderer) { if ($this->x1 === ReportBaseElement::CURRENT_POSITION) { $this->x1 = $renderer->GetX(); } if ($this->y1 === ReportBaseElement::CURRENT_POSITION) { $this->y1 = $renderer->GetY(); } if ($this->x2 === ReportBaseElement:...
php
{ "resource": "" }
q20720
ReportPdfImage.render
train
public function render($renderer) { static $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright; // Check for a pagebreak first if ($renderer->checkPageBreakPDF($this->height + 5)) { $this->y = $renderer->GetY(); } $curx = $renderer->GetX(); // Get...
php
{ "resource": "" }
q20721
TreeView.getPersons
train
public function getPersons(Tree $tree, string $request): string { $json_requests = explode(';', $request); $r = []; foreach ($json_requests as $json_request) { $firstLetter = substr($json_request, 0, 1); $json_request = substr($json_request, 1); switch...
php
{ "resource": "" }
q20722
TreeView.getPersonDetails
train
private function getPersonDetails(Individual $individual, Family $family = null): string { $chart_url = route('module', [ 'module' => 'tree', 'action' => 'Chart', 'xref' => $individual->xref(), 'ged' => $individual->tree()->name(), ]); $h...
php
{ "resource": "" }
q20723
TreeView.drawChildren
train
private function drawChildren(Collection $familyList, int $gen = 1, bool $ajax = false): string { $html = ''; $children2draw = []; $f2load = []; foreach ($familyList as $f) { $children = $f->children(); if ($children->isNotEmpty()) { ...
php
{ "resource": "" }
q20724
TreeView.drawPersonName
train
private function drawPersonName(Individual $individual, string $dashed): string { $family = $individual->primaryChildFamily(); if ($family) { $family_name = strip_tags($family->fullName()); } else { $family_name = I18N::translateContext('unknown family', 'unknown'); ...
php
{ "resource": "" }
q20725
Fact.value
train
public function value(): string { if (preg_match('/^1 (?:' . $this->tag . ') ?(.*(?:(?:\n2 CONT ?.*)*))/', $this->gedcom, $match)) { return
php
{ "resource": "" }
q20726
Fact.target
train
public function target() { $xref = trim($this->value(), '@'); switch ($this->tag) { case 'FAMC': case 'FAMS': return Family::getInstance($xref, $this->record()->tree()); case 'HUSB': case 'WIFE': case 'CHIL': ...
php
{ "resource": "" }
q20727
Fact.attribute
train
public function attribute($tag): string { if (preg_match('/\n2 (?:' . $tag . ') ?(.*(?:(?:\n3 CONT ?.*)*)*)/', $this->gedcom, $match)) { return
php
{ "resource": "" }
q20728
Fact.canShow
train
public function canShow(int $access_level = null): bool { if ($access_level === null) { $access_level = Auth::accessLevel($this->record()->tree()); } // Does this record have an explicit RESN? if (strpos($this->gedcom, "\n2 RESN confidential") !== false) { re...
php
{ "resource": "" }
q20729
Fact.canEdit
train
public function canEdit(): bool { if ($this->isPendingDeletion()) { return false; } if (Auth::isManager($this->record->tree())) { return true; } // Members cannot edit RESN, CHAN and locked records
php
{ "resource": "" }
q20730
Fact.place
train
public function place(): Place { if ($this->place === null) { $this->place =
php
{ "resource": "" }
q20731
Fact.date
train
public function date(): Date { if ($this->date === null) {
php
{ "resource": "" }
q20732
Fact.label
train
public function label(): string { // Custom FACT/EVEN - with a TYPE if (($this->tag === 'FACT' || $this->tag === 'EVEN') && $this->attribute('TYPE') !== '') {
php
{ "resource": "" }
q20733
Fact.getCitations
train
public function getCitations(): array { preg_match_all('/\n(2 SOUR @(' . Gedcom::REGEX_XREF . ')@(?:\n[3-9] .*)*)/', $this->gedcom(), $matches, PREG_SET_ORDER); $citations = []; foreach ($matches as $match) { $source = Source::getInstance($match[2], $this->record()->tree());
php
{ "resource": "" }
q20734
Fact.getMedia
train
public function getMedia(): array { $media = []; preg_match_all('/\n2 OBJE @(' . Gedcom::REGEX_XREF . ')@/', $this->gedcom(), $matches);
php
{ "resource": "" }
q20735
Fact.dateComparator
train
private static function dateComparator(): Closure { return static function (Fact $a, Fact $b): int { if ($a->date()->isOK() && $b->date()->isOK()) { // If both events have dates, compare by date $ret = Date::compare($a->date(), $b->date()); if ($r...
php
{ "resource": "" }
q20736
Fact.typeComparator
train
public static function typeComparator(): Closure { static $factsort = []; if (empty($factsort)) { $factsort = array_flip(self::FACT_ORDER); } return static function (Fact $a, Fact $b) use ($factsort): int { // Facts from same families stay grouped together ...
php
{ "resource": "" }
q20737
Fact.sortFacts
train
public static function sortFacts(Collection $unsorted): Collection { $dated = []; $nondated = []; $sorted = []; // Split the array into dated and non-dated arrays $order = 0; foreach ($unsorted as $fact) { $fact->sortOrder = $order; $ord...
php
{ "resource": "" }
q20738
FanChartModule.splitAlignText
train
protected function splitAlignText(string $data, int $maxlen): string { $RTLOrd = [ 215, 216, 217, 218, 219, ]; $lines = explode("\n", $data); // more than 1 line : recursive calls if (count($lines) > 1) { ...
php
{ "resource": "" }
q20739
FanChartModule.imageColor
train
protected function imageColor($image, string $css_color): int { return imagecolorallocate( $image, (int) hexdec(substr($css_color, 0, 2)),
php
{ "resource": "" }
q20740
RomanNumeralsService.numberToRomanNumerals
train
public function numberToRomanNumerals(int $number): string { if ($number < 1) { // Cannot convert zero/negative numbers return (string) $number; } $roman = ''; foreach (self::ROMAN_NUMERALS as $key => $value) {
php
{ "resource": "" }
q20741
RomanNumeralsService.romanNumeralsToNumber
train
public function romanNumeralsToNumber(string $roman): int { $num = 0; foreach (self::ROMAN_NUMERALS as $key => $value) { while (strpos($roman, $value) === 0) { $num
php
{ "resource": "" }
q20742
FamilyTreeFavoritesModule.getFavorites
train
public function getFavorites(Tree $tree): array { return DB::table('favorite') ->where('gedcom_id', '=', $tree->id()) ->whereNull('user_id') ->get() ->map(static function (stdClass $row) use ($tree): stdClass { if ($row->xref !== null) { ...
php
{ "resource": "" }
q20743
BatchUpdateModule.getPluginList
train
private function getPluginList(): array { $plugins = []; $files = glob(__DIR__ . '/BatchUpdate/BatchUpdate*Plugin.php', GLOB_NOSORT); foreach ($files as $file) { $base_class = basename($file, '.php'); if ($base_class !== 'BatchUpdateBasePlugin') {
php
{ "resource": "" }
q20744
BatchUpdateModule.allData
train
private function allData(BatchUpdateBasePlugin $plugin, Tree $tree): array { $tmp = []; foreach ($plugin->getRecordTypesToUpdate() as $type) { switch ($type) { case 'INDI': $rows = DB::table('individuals') ->where('i_file', '='...
php
{ "resource": "" }
q20745
BatchUpdateModule.findNextXref
train
private function findNextXref(BatchUpdateBasePlugin $plugin, string $xref, array $all_data, Tree $tree): string { foreach (array_keys($all_data) as $key) { if ($key > $xref) { $record = $this->getRecord($all_data[$key], $tree);
php
{ "resource": "" }
q20746
BatchUpdateModule.findPrevXref
train
private function findPrevXref(BatchUpdateBasePlugin $plugin, string $xref, array $all_data, Tree $tree): string { foreach (array_reverse($all_data) as $key => $value) { if ($key > $xref) { $record =
php
{ "resource": "" }
q20747
ReportBaseHtml.getStart
train
public function getStart(): string { $str = '<' . $this->tag . ' '; foreach ($this->attrs as $key => $value) {
php
{ "resource": "" }
q20748
ReportPdfPageheader.render
train
public function render($renderer) { $renderer->clearPageHeader(); foreach ($this->elements as $element) {
php
{ "resource": "" }
q20749
MediaController.allMediaFolders
train
private function allMediaFolders(): Collection { $base_folders = DB::table('gedcom_setting') ->where('setting_name', '=', 'MEDIA_DIRECTORY') ->select(DB::raw("setting_value || 'dummy.jpeg' AS path")); return DB::table('media_file') ->join('gedcom_setting', 'gedco...
php
{ "resource": "" }
q20750
MediaController.allDiskFiles
train
private function allDiskFiles(string $media_folder, string $subfolders): array
php
{ "resource": "" }
q20751
MediaController.mediaObjectInfo
train
private function mediaObjectInfo(Media $media): string { $html = '<b><a href="' . e($media->url()) . '">' . $media->fullName() . '</a></b>' . '<br><i>' . e($media->getNote()) . '</i></br><br>'; $linked = []; foreach ($media->linkedIndividuals('OBJE') as $link) { $linked[] = '<a ...
php
{ "resource": "" }
q20752
MediaController.allMediaFiles
train
private function allMediaFiles(string $media_folder, string $subfolders): array { $query = DB::table('media_file') ->join('gedcom_setting', 'gedcom_id', '=', 'm_file') ->where('setting_name', '=', 'MEDIA_DIRECTORY') ->where('multimedia_file_refn', 'LIKE', '%/%') ...
php
{ "resource": "" }
q20753
Mail.send
train
public static function send(UserInterface $from, UserInterface $to, UserInterface $reply_to, $subject, $message_text, $message_html): bool { try { $message_text = preg_replace('/\r?\n/', "\r\n", $message_text); $message_html = preg_replace('/\r?\n/', "\r\n", $message_html); ...
php
{ "resource": "" }
q20754
Mail.transport
train
public static function transport(): Swift_Transport { switch (Site::getPreference('SMTP_ACTIVE')) { case 'sendmail': // Local sendmail (requires PHP proc_* functions) return new Swift_SendmailTransport(); case 'external': // SMTP ...
php
{ "resource": "" }
q20755
FunctionsEdit.optionsRestrictions
train
public static function optionsRestrictions($include_empty): array { $options = [ 'none' => I18N::translate('Show to visitors'), 'privacy' => I18N::translate('Show to members'), 'confidential' => I18N::translate('Show to managers'), 'locked'
php
{ "resource": "" }
q20756
FunctionsEdit.optionsRestrictionsRule
train
public static function optionsRestrictionsRule(): array { $options = [ 'none' => I18N::translate('Show to visitors'), 'privacy' => I18N::translate('Show to members'),
php
{ "resource": "" }
q20757
FunctionsEdit.addSimpleTags
train
public static function addSimpleTags(Tree $tree, $fact): void { // For new individuals, these facts default to "Y" if ($fact === 'MARR') { echo self::addSimpleTag($tree, '0 ' . $fact . ' Y'); } else { echo self::addSimpleTag($tree, '0 ' . $fact); } if...
php
{ "resource": "" }
q20758
FunctionsEdit.createAddForm
train
public static function createAddForm(Tree $tree, $fact): void { self::$tags = []; // handle MARRiage TYPE if (substr($fact, 0, 5) === 'MARR_') { self::$tags[0] = 'MARR'; echo self::addSimpleTag($tree, '1 MARR'); self::insertMissingSubtags($tree, $fact); ...
php
{ "resource": "" }
q20759
Note.getNote
train
public function getNote(): string { if (preg_match('/^0 @' . Gedcom::REGEX_XREF . '@ NOTE ?(.*(?:\n1 CONT ?.*)*)/', $this->gedcom . $this->pending, $match)) {
php
{ "resource": "" }
q20760
IndividualListService.whereFamily
train
private function whereFamily(bool $fams, Builder $query): void { if ($fams) { $query->join('link', static function (JoinClause $join): void {
php
{ "resource": "" }
q20761
IndividualListService.surnameAlpha
train
public function surnameAlpha(bool $marnm, bool $fams, string $locale, string $collation): array { $n_surn = $this->fieldWithCollation('n_surn', $collation); $alphas = []; $query = DB::table('name')->where('n_file', '=', $this->tree->id()); $this->whereFamily($fams, $query); ...
php
{ "resource": "" }
q20762
IndividualListService.givenAlpha
train
public function givenAlpha(string $surn, string $salpha, bool $marnm, bool $fams, string $locale, string $collation): array { $alphas = []; $query = DB::table('name') ->where('n_file', '=', $this->tree->id()); $this->whereFamily($fams, $query); $this->whereMarriedName($...
php
{ "resource": "" }
q20763
IndividualListService.surnames
train
public function surnames(string $surn, string $salpha, bool $marnm, bool $fams, string $locale, string $collation): array { $query = DB::table('name') ->where('n_file', '=', $this->tree->id()) ->select([ DB::raw('UPPER(n_surn /*! COLLATE ' . I18N::collation() . ' */) ...
php
{ "resource": "" }
q20764
IndividualListService.fieldWithCollation
train
private function fieldWithCollation(string $field, string $collation): Expression
php
{ "resource": "" }
q20765
IndividualListService.whereInitial
train
private function whereInitial(Builder $query, string $field, string $letter, string $locale, string $collation): void { // Use MySQL-specific comments so we can run these queries on other RDBMS. $field_with_collation = $this->fieldWithCollation($field, $collation); switch ($locale) { ...
php
{ "resource": "" }
q20766
IndividualListService.whereInitialHungarian
train
private function whereInitialHungarian(Builder $query, Expression $field, string $letter): void { switch ($letter) { case 'C': $query->where($field, 'LIKE', 'C%')->where($field, 'NOT LIKE', 'CS%'); break; case 'D': $query->where($field...
php
{ "resource": "" }
q20767
GedcomCodeRela.getValues
train
public static function getValues(GedcomRecord $record = null): array { $values = []; foreach (self::TYPES as $type)
php
{ "resource": "" }
q20768
IndividualRepository.commonGivenQuery
train
private function commonGivenQuery(string $sex, string $type, bool $show_tot, int $threshold, int $maxtoshow) { $query = DB::table('name') ->join('individuals', static function (JoinClause $join): void { $join ->on('i_file', '=', 'n_file') -...
php
{ "resource": "" }
q20769
IndividualRepository.statsBirthBySexQuery
train
public function statsBirthBySexQuery(int $year1 = -1, int $year2 = -1): Builder { return $this->statsBirthQuery($year1, $year2) ->select(['d_month', 'i_sex', DB::raw('COUNT(*) AS total')])
php
{ "resource": "" }
q20770
IndividualRepository.statsBirth
train
public function statsBirth(string $color_from = null, string $color_to = null): string
php
{ "resource": "" }
q20771
IndividualRepository.statsDeathBySexQuery
train
public function statsDeathBySexQuery(int $year1 = -1, int $year2 = -1): Builder { return $this->statsDeathQuery($year1, $year2) ->select(['d_month', 'i_sex', DB::raw('COUNT(*) AS total')])
php
{ "resource": "" }
q20772
IndividualRepository.statsDeath
train
public function statsDeath(string $color_from = null, string $color_to = null): string
php
{ "resource": "" }
q20773
IndividualRepository.statsAgeQuery
train
public function statsAgeQuery(string $related = 'BIRT', string $sex = 'BOTH', int $year1 = -1, int $year2 = -1) { $prefix = DB::connection()->getTablePrefix(); $query = $this->birthAndDeathQuery($sex); if ($year1 >= 0 && $year2 >= 0) { $query ->whereIn('birth.d_...
php
{ "resource": "" }
q20774
IndividualRepository.topTenOldestFemale
train
public function topTenOldestFemale(int $total = 10): string { $records = $this->topTenOldestQuery('F', $total);
php
{ "resource": "" }
q20775
IndividualRepository.topTenOldestFemaleList
train
public function topTenOldestFemaleList(int $total = 10): string { $records = $this->topTenOldestQuery('F', $total);
php
{ "resource": "" }
q20776
IndividualRepository.averageLifespanQuery
train
private function averageLifespanQuery(string $sex, bool $show_years): string { $prefix = DB::connection()->getTablePrefix(); $days = (int) $this->birthAndDeathQuery($sex) ->select(DB::raw('AVG(' . $prefix . 'death.d_julianday2 - ' . $prefix . 'birth.d_julianday1) AS days'))
php
{ "resource": "" }
q20777
IndividualRepository.getPercentage
train
private function getPercentage(int $count, int $total): string { return ($total !== 0) ?
php
{ "resource": "" }
q20778
IndividualRepository.totalLivingQuery
train
private function totalLivingQuery(): int { $query = DB::table('individuals') ->where('i_file', '=', $this->tree->id()); foreach (Gedcom::DEATH_EVENTS as $death_event) {
php
{ "resource": "" }
q20779
IndividualRepository.totalDeceasedQuery
train
private function totalDeceasedQuery(): int { return DB::table('individuals') ->where('i_file', '=', $this->tree->id()) ->where(static function (Builder $query): void { foreach (Gedcom::DEATH_EVENTS as $death_event) {
php
{ "resource": "" }
q20780
IndividualRepository.getTotalSexQuery
train
private function getTotalSexQuery(string $sex): int { return DB::table('individuals') ->where('i_file', '=', $this->tree->id())
php
{ "resource": "" }
q20781
IndividualRepository.totalIndisWithSourcesQuery
train
private function totalIndisWithSourcesQuery(): int { return DB::table('individuals') ->select(['i_id']) ->distinct() ->join('link', static function (JoinClause $join): void { $join->on('i_id', '=', 'l_from')
php
{ "resource": "" }
q20782
IndividualRepository.totalRecordsQuery
train
private function totalRecordsQuery(): int { return $this->totalIndividualsQuery() + $this->totalFamiliesQuery() + $this->totalNotesQuery()
php
{ "resource": "" }
q20783
IndividualRepository.birthAndDeathQuery
train
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') ...
php
{ "resource": "" }
q20784
Place.parent
train
public function parent(): Place { return new
php
{ "resource": "" }
q20785
Place.getChildPlaces
train
public function getChildPlaces(): array { if ($this->place_name !== '') { $parent_text = Gedcom::PLACE_SEPARATOR . $this->place_name; } else { $parent_text = ''; } return DB::table('places') ->where('p_file', '=', $this->tree->id()) ->...
php
{ "resource": "" }
q20786
Place.url
train
public function url(): string { //find a module providing the place hierarchy $module = app(ModuleService::class) ->findByComponent(ModuleListInterface::class, $this->tree, Auth::user()) ->first(static function (ModuleInterface $module): bool {
php
{ "resource": "" }
q20787
Place.placeName
train
public function placeName(): string { $place_name = $this->parts->first() ?? I18N::translate('unknown');
php
{ "resource": "" }
q20788
Place.fullName
train
public function fullName(bool $link = false): string { if ($this->parts->isEmpty()) { return ''; } $full_name = $this->parts->implode(I18N::$list_separator); if ($link) {
php
{ "resource": "" }
q20789
Family.marriageDateComparator
train
public static function marriageDateComparator(): Closure { return static function (Family $x, Family $y): int {
php
{ "resource": "" }
q20790
Family.spouse
train
public function spouse(Individual $person, $access_level = null): ?Individual { if ($person
php
{ "resource": "" }
q20791
Family.numberOfChildren
train
public function numberOfChildren(): int { $nchi = $this->children()->count(); foreach ($this->facts(['NCHI']) as $fact) {
php
{ "resource": "" }
q20792
Family.getMarriagePlace
train
public function getMarriagePlace(): Place { $marriage = $this->getMarriage(); if ($marriage instanceof Fact) {
php
{ "resource": "" }
q20793
Family.getAllMarriagePlaces
train
public function getAllMarriagePlaces(): array { foreach (Gedcom::MARRIAGE_EVENTS as $event) { $places = $this->getAllEventPlaces([$event]);
php
{ "resource": "" }
q20794
VerifyEmailController.verify
train
public function verify(ServerRequestInterface $request, Tree $tree, UserService $user_service): ResponseInterface { $username = $request->get('username', ''); $token = $request->get('token', ''); $title = I18N::translate('User verification'); $user = $user_service->findByUserNam...
php
{ "resource": "" }
q20795
ImportThumbnailsController.findMediaObjectsForMediaFile
train
private function findMediaObjectsForMediaFile(string $file): array { return DB::table('media') ->join('media_file', static function (JoinClause $join): void { $join ->on('media_file.m_file', '=', 'media.m_file')
php
{ "resource": "" }
q20796
ImportThumbnailsController.scaledImagePixels
train
private function scaledImagePixels($path): array { $size = 10; $sha1 = sha1_file($path); $cache_file = WT_DATA_DIR . 'cache/' . $sha1 . '.php'; if (file_exists($cache_file)) { return include $cache_file; } $manager = new ImageManager(); ...
php
{ "resource": "" }
q20797
ReportTcpdf.header
train
public function header() { foreach ($this->headerElements as $element) { if ($element instanceof ReportBaseElement) { $element->render($this); } elseif ($element === 'footnotetexts') { $this->footnotes(); } elseif ($element === 'addpage') {...
php
{ "resource": "" }
q20798
ReportTcpdf.body
train
public function body() { $this->AddPage(); foreach ($this->bodyElements as $key => $element) { if ($element instanceof ReportBaseElement) { $element->render($this); } elseif ($element === 'footnotetexts') {
php
{ "resource": "" }
q20799
ReportTcpdf.footnotes
train
public function footnotes() { foreach ($this->printedfootnotes as $element) { if (($this->GetY() + $element->getFootnoteHeight($this)) > $this->getPageHeight()) { $this->AddPage(); }
php
{ "resource": "" }