src/SkeVent.php
public static function getLeadTimeFactor(string $strFactor, int $iLeadTime)
    {
        // minutes
        if ($iLeadTime < 60 || $iLeadTime % 60 !== 0) {
            $iNum = $iLeadTime;
            $iUnit = 1;
        // hours
        } elseif ($iLeadTime % (24 * 60) !== 0) {
            $iNum = $iLeadTime / 60;
            $iUnit = 60;
        // days
        } else {
            $iNum = $iLeadTime / (24 * 60);
            $iUnit = 24 * 60;
        }

        return ${'i' . ucfirst(strtolower(str_replace('lead_time_', '', $strFactor)))};
    }
public static function getLeadTimeFactor(string $strFactor, int $iLeadTime)
    {
        // minutes
        if ($iLeadTime < 60 || $iLeadTime % 60 !== 0) {
            $iNum = $iLeadTime;
            $iUnit = 1;
        // hours
        } elseif ($iLeadTime % (24 * 60) !== 0) {
            $iNum = $iLeadTime / 60;
            $iUnit = 60;
        // days
        } else {
            $iNum = $iLeadTime / (24 * 60);
            $iUnit = 24 * 60;
        }

        return ${'i' . ucfirst(strtolower(str_replace('lead_time_', '', $strFactor)))};
    }
public static function getLeadTimeFactor ( string $ strFactor , int $ iLeadTime ) { // minutes if ( $ iLeadTime < 60 || $ iLeadTime % 60 !== 0 ) { $ iNum = $ iLeadTime ; $ iUnit = 1 ; // hours } elseif ( $ iLeadTime % ( 24 * 60 ) !== 0 ) { $ iNum = $ iLeadTime / 60 ; $ iUnit = 60 ; // days } else { $ iNum = $ iLeadTime / ( 24 * 60 ) ; $ iUnit = 24 * 60 ; } return $ { 'i' . ucfirst ( strtolower ( str_replace ( 'lead_time_' , '' , $ strFactor ) ) ) } ; }
Get the "num" or "unit" factor from the lead time.

@param string $strFactor "lead_time_num" or "lead_time_unit"
@return int
Get the num or unit factor from the lead time .