public function getText(DateInterval $diff, $date)
    {
        if ($this->now($diff)) {
            return $this->text_translator->now();
        }
        
        if ($this->minutes($diff)) {
            return $this->text_translator->minutes($this->minutes($diff));
        }
        
        if ($this->hours($diff)) {
            return $this->text_translator->hours($this->hours($diff));
        }
        
        if ($this->days($diff)) {
            return $this->text_translator->days($this->days($diff));
        }

        if ($this->text_translator->supportsWeeks() && $this->weeks($diff)) {
            return $this->text_translator->weeks($this->weeks($diff));
        }

        if ($this->text_translator->supportsMonths() && $this->months($diff)) {
            return $this->text_translator->months($this->months($diff));
        }

        if ($this->text_translator->supportsYears() && $this->years($diff)) {
            return $this->text_translator->years($this->years($diff));
        }
        
        return $date->format($this->format);
    }
public function getText(DateInterval $diff, $date)
    {
        if ($this->now($diff)) {
            return $this->text_translator->now();
        }
        
        if ($this->minutes($diff)) {
            return $this->text_translator->minutes($this->minutes($diff));
        }
        
        if ($this->hours($diff)) {
            return $this->text_translator->hours($this->hours($diff));
        }
        
        if ($this->days($diff)) {
            return $this->text_translator->days($this->days($diff));
        }

        if ($this->text_translator->supportsWeeks() && $this->weeks($diff)) {
            return $this->text_translator->weeks($this->weeks($diff));
        }

        if ($this->text_translator->supportsMonths() && $this->months($diff)) {
            return $this->text_translator->months($this->months($diff));
        }

        if ($this->text_translator->supportsYears() && $this->years($diff)) {
            return $this->text_translator->years($this->years($diff));
        }
        
        return $date->format($this->format);
    }
public function getText ( DateInterval $ diff , $ date ) { if ( $ this -> now ( $ diff ) ) { return $ this -> text_translator -> now ( ) ; } if ( $ this -> minutes ( $ diff ) ) { return $ this -> text_translator -> minutes ( $ this -> minutes ( $ diff ) ) ; } if ( $ this -> hours ( $ diff ) ) { return $ this -> text_translator -> hours ( $ this -> hours ( $ diff ) ) ; } if ( $ this -> days ( $ diff ) ) { return $ this -> text_translator -> days ( $ this -> days ( $ diff ) ) ; } if ( $ this -> text_translator -> supportsWeeks ( ) && $ this -> weeks ( $ diff ) ) { return $ this -> text_translator -> weeks ( $ this -> weeks ( $ diff ) ) ; } if ( $ this -> text_translator -> supportsMonths ( ) && $ this -> months ( $ diff ) ) { return $ this -> text_translator -> months ( $ this -> months ( $ diff ) ) ; } if ( $ this -> text_translator -> supportsYears ( ) && $ this -> years ( $ diff ) ) { return $ this -> text_translator -> years ( $ this -> years ( $ diff ) ) ; } return $ date -> format ( $ this -> format ) ; }
Get string related to DateInterval object
@param DateInterval $diff
@return string
Get string related to DateInterval object