Interface that all Periods must implement.
bool |
contains( DateTime $date)
Checks if the given period is contained in the current period |
|
DateTime |
getBegin()
Gets the DateTime of period begin |
|
DateTime |
getEnd()
Gets the DateTime of the period end |
|
PeriodInterface |
getNext()
Gets the next period of the same type |
|
PeriodInterface |
getPrevious()
Gets the previous period of the same type |
|
DatePeriod |
getDatePeriod()
Returns the period as a DatePeriod |
|
bool |
equals( PeriodInterface $period)
Checks if a period is equals to an other |
|
includes( PeriodInterface $period, bool $strict = true)
Returns true if the period include the other period given as argument |
||
boolean |
containsEvent( EventInterface $event)
Returns if $event is during this period. |
|
string |
format( string $format)
Format the period to a string |
|
boolean |
isCurrent()
Returns if the current period is the current one |
|
setFirstWeekday( int $firstWeekday)
Sets the first day of week |
||
static |
isValid( DateTime $start)
Checks if $start is good for building the period |
|
static DateInterval |
getDateInterval()
Returns a \DateInterval equivalent to the period |
public bool
contains( DateTime $date)
Checks if the given period is contained in the current period
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public DateTime
getBegin()
public DateTime
getEnd()
public PeriodInterface
getNext()
public PeriodInterface
getPrevious()
public DatePeriod
getDatePeriod()
public bool
equals( PeriodInterface $period)
public
includes( PeriodInterface $period, bool $strict = true)
Returns true if the period include the other period given as argument
Parameters |
|
---|
public boolean
containsEvent( EventInterface $event)
Returns if $event is during this period.
Non strict. Must return true if : * Event is during period * Period is during event * Event begin is during Period * Event end is during Period
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public string
format( string $format)
Format the period to a string
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public boolean
isCurrent()
Returns if the current period is the current one
Return Value |
|
---|
public
setFirstWeekday( int $firstWeekday)
Sets the first day of week
Parameters |
|
---|
static public
isValid( DateTime $start)
Checks if $start is good for building the period
Parameters |
|
---|
static public DateInterval
getDateInterval()