Phue\Command\CreateSchedule::time PHP Method

time() public method

Set time
public time ( string $time ) : self
$time string Time
return self This object
    public function time($time)
    {
        if (!$time instanceof TimePatternInterface) {
            $time = new AbsoluteTime((string) $time);
        }
        $this->time = $time;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Test: Set time
  *
  * @covers \Phue\Command\CreateSchedule::time
  */
 public function testTime()
 {
     $x = new CreateSchedule();
     $command = $x->time('2010-10-20T10:11:12');
     // Ensure property is set properly
     $this->assertAttributeInstanceOf('\\Phue\\TimePattern\\TimePatternInterface', 'time', $command);
     // Ensure self object is returned
     $this->assertEquals($command, $command->time('+10 seconds'));
 }