business\Time::isBeforeOrEqual PHP Method

isBeforeOrEqual() public method

Checks if this time is before or equal to an other time.
public isBeforeOrEqual ( Time $other ) : boolean
$other Time
return boolean
    public function isBeforeOrEqual(Time $other)
    {
        return $this->toInteger() <= $other->toInteger();
    }

Usage Example

Beispiel #1
0
 public function testIsBeforeOrEqual()
 {
     $time = new Time('20', '00');
     $this->assertTrue($time->isBeforeOrEqual(new Time('22', '00')));
     $this->assertFalse($time->isBeforeOrEqual(new Time('18', '15')));
     $this->assertTrue($time->isBeforeOrEqual(new Time('20', '00')));
 }