$this->iTable, 'ID' => $this->iId, 'House number' => $this->iHouseNumber, 'Exact Matches' => $this->iExactMatches, 'Result rank' => $this->iResultRank ); } public function __construct($sId, $iTable = Result::TABLE_PLACEX) { $this->iTable = $iTable; $this->iId = (int) $sId; } public static function joinIdsByTable($aResults, $iTable) { return join(',', array_keys(array_filter( $aResults, function ($aValue) use ($iTable) { return $aValue->iTable == $iTable; } ))); } public static function sqlHouseNumberTable($aResults, $iTable) { $sHousenumbers = ''; $sSep = ''; foreach ($aResults as $oResult) { if ($oResult->iTable == $iTable) { $sHousenumbers .= $sSep.'('.$oResult->iId.','; $sHousenumbers .= $oResult->iHouseNumber.')'; $sSep = ','; } } return $sHousenumbers; } }