business\Time::isBeforeOrEqual PHP Méthode

isBeforeOrEqual() public méthode

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

Usage Example

Exemple #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')));
 }