Translate timeslot id.

@param $oldTimeslotId
@return mixed
@throws TimeslotNotFoundByNameException
484342
protected function translateTimeslotId($oldTimeslotId)
    {
        $timeslot = ScoolTimeslot::where('order',Timeslot::findOrFail($oldTimeslotId)->order)->first();
        if ( $timeslot != null ) {
            return $timeslot->id;
        }
        throw new TimeslotNotFoundByNameException();
    }
613649
public function getTimezoneName($timezoneID)
    {
        $result = '';
        if (is_string($timezoneID) && $timezoneID !== '') {
            $names = $this->getTimezones();
            $result = isset($names[$timezoneID]) ? $names[$timezoneID] : $timezoneID;
        }

        return $result;
    }
901992
public function translationByLanguageID( $languageID )
    {
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetch( $languageID );
        if ( $language instanceof eZContentLanguage )
            return $this->translationByLocale( $language->attribute( 'locale' ) );

        return false;
    }
618228
function (translationId) {

          // Remove any old watcher
          if (angular.isFunction(observeElementTranslation._unwatchOld)) {
            observeElementTranslation._unwatchOld();
            observeElementTranslation._unwatchOld = undefined;
          }

          if (angular.equals(translationId , '') || !angular.isDefined(translationId)) {
            // Resolve translation id by inner html if required
            var interpolateMatches = trim.apply(iElement.text()).match(interpolateRegExp);
            // Interpolate translation id if required
            if (angular.isArray(interpolateMatches)) {
              scope.preText = interpolateMatches[1];
              scope.postText = interpolateMatches[3];
              translationIds.translate = $interpolate(interpolateMatches[2])(scope.$parent);
              var watcherMatches = iElement.text().match(watcherRegExp);
              if (angular.isArray(watcherMatches) && watcherMatches[2] && watcherMatches[2].length) {
                observeElementTranslation._unwatchOld = scope.$watch(watcherMatches[2], function (newValue) {
                  translationIds.translate = newValue;
                  updateTranslations();
                });
              }
            } else {
              translationIds.translate = iElement.text().replace(/^\s+|\s+$/g,'');
            }
          } else {
            translationIds.translate = translationId;
          }
          updateTranslations();
        }
519882
public function convertTime($timestamp)
    {
        $ts = new BigNumber($timestamp, 20);
        $ts->subtract('122192928000000000');
        $ts->divide('10000000.0');
        $ts->round();

        return $ts->getValue();
    }
1124120
function processIDText()
    {
        if ( is_numeric( $this->ProcessID ) and $this->ProcessID > 0 )
        {
            return $this->ProcessID;
        }

        return ezpI18n::tr( 'ezscriptmonitor', 'n/a' );
    }
336118
protected function translateClassroomId($oldClassroomId)
    {
        $classroom = Classroom::where('name',ClassroomGroup::findOrFail($oldClassroomId)->name)->first();
        if ( $classroom != null ) {
            return $classroom->id;
        }
        throw new ClassroomNotFoundByNameException();
    }
819022
def tzname(self, dt):
        """"""
        tt = _localtime(_mktime((dt.year, dt.month, dt.day,
                 dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1)))
        return _time.tzname[tt.tm_isdst > 0]
186052
public static function fromString(string $dateTimeString, string $timeZoneId) : TimezonedDateTime
    {
        return new self(new \DateTimeImmutable($dateTimeString, new \DateTimeZone($timeZoneId)));
    }
1059871
public function get_mappingid($itemname, $oldid, $ifnotfound = false) {
        $mapping = $this->get_mapping($itemname, $oldid);
        return $mapping ? $mapping->newitemid : $ifnotfound;
    }
1033718
public static function convertDate($oldDateString, $newDateFormatString, $timezone = null) {
		$Date = new CakeTime($oldDateString, $timezone);
		return $Date->format($newDateFormatString);
	}
166401
protected function translateStudyId($oldStudyId)
    {
        $study = ScoolStudy::where('name',Study::findOrFail($oldStudyId)->name)->first();
        if ( $study != null ) {
            return $study->id;
        }
        throw new StudyNotFoundByNameException();
    }
916302
protected function _defineAndCheckDefaultTimeValues($blToTimeStamp)
    {
        // defining time format
        // checking for default values
        $sLocalTimeFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalTimeFormat');
        if (!$sLocalTimeFormat || $blToTimeStamp) {
            $sLocalTimeFormat = "ISO";
        }

        return $sLocalTimeFormat;
    }
734268
public static function formatOther($timestamp, $format = 'eeee')
    {
        $instance=self::$_instance;
        $fmt=new IntlDateFormatter($instance->_currentLocale, 0, 0);
        $fmt->setPattern($format);
        return $fmt->format($timestamp);
    }
488509
protected function translateColumnNames($names)
    {
        if (!$this->apiMethod) {
            return $names;
        }

        // load the translations only once
        // when multiple dates are requested (date=...,...&period=day), the meta data would
        // be loaded lots of times otherwise
        if ($this->columnTranslations === false) {
            $meta = $this->getApiMetaData();
            if ($meta === false) {
                return $names;
            }

            $t = Metrics::getDefaultMetricTranslations();
            foreach (array('metrics', 'processedMetrics', 'metricsGoal', 'processedMetricsGoal') as $index) {
                if (isset($meta[$index]) && is_array($meta[$index])) {
                    $t = array_merge($t, $meta[$index]);
                }
            }

            foreach (Dimension::getAllDimensions() as $dimension) {
                $dimensionId   = str_replace('.', '_', $dimension->getId());
                $dimensionName = $dimension->getName();

                if (!empty($dimensionId) && !empty($dimensionName)) {
                    $t[$dimensionId] = $dimensionName;
                }
            }

            $this->columnTranslations = & $t;
        }

        foreach ($names as &$name) {
            if (isset($this->columnTranslations[$name])) {
                $name = $this->columnTranslations[$name];
            }
        }

        return $names;
    }
207489
private function updateMenuLinkLabel(int $id, array $newTitle, $oldTitle)
    {
        $menuLinksList = MenuLink::where('belongsToID', $id)->where('belongsTo', 'category')->get();

        $langSlug = App::getLocale();
        if($menuLinksList->count()) {
            foreach ($menuLinksList as $menuLink){
                $updateLabel = false;
                foreach (Language::all() as $lang){
                    $langSlug = $lang->slug;
                    if(isset($oldTitle->App) && $oldTitle->$langSlug == $menuLink->label->$langSlug) {
                        $updateLabel = true;
                    }
                }

                if($updateLabel) {
                    $link = MenuLink::find($menuLink->menuLinkID);
                    $link->label = $newTitle;
                    $link->save();
                }
            }
        }
    }
502029
public function toMySQLDate($withTime = true)
    {
        if ($this->isHollow()) {
            return $withTime ? '0000-00-00 00:00:00' : '0000-00-00';
        }

        $format = $withTime ? 'Y-m-d H:i:s' : 'Y-m-d';

        return $this->format($format);
    }