PHP 클래스 Knp\Bundle\TimeBundle\DateTimeFormatter

파일 보기 프로젝트 열기: KnpLabs/KnpTimeBundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$translator

공개 메소드들

메소드 설명
__construct ( Symfony\Component\Translation\TranslatorInterface $translator ) Constructor
formatDiff ( DateTimeInterface $from, DateTimeInterface $to ) : string Returns a formatted diff for the given from and to datetimes
getDiffMessage ( integer $count, boolean $invert, integer $unit ) : string Returns the diff message for the specified count and unit
getEmptyDiffMessage ( ) : string Returns the message for an empty diff

보호된 메소드들

메소드 설명
doGetDiffMessage ( $count, $invert, $unit )

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Symfony\Component\Translation\TranslatorInterface $translator )
$translator Symfony\Component\Translation\TranslatorInterface Translator used for messages

doGetDiffMessage() 보호된 메소드

protected doGetDiffMessage ( $count, $invert, $unit )

formatDiff() 공개 메소드

Returns a formatted diff for the given from and to datetimes
public formatDiff ( DateTimeInterface $from, DateTimeInterface $to ) : string
$from DateTimeInterface
$to DateTimeInterface
리턴 string

getDiffMessage() 공개 메소드

Returns the diff message for the specified count and unit
public getDiffMessage ( integer $count, boolean $invert, integer $unit ) : string
$count integer The diff count
$invert boolean Whether to invert the count
$unit integer The unit must be either year, month, day, hour, minute or second
리턴 string

getEmptyDiffMessage() 공개 메소드

Returns the message for an empty diff
public getEmptyDiffMessage ( ) : string
리턴 string

프로퍼티 상세

$translator 보호되어 있는 프로퍼티

protected $translator