build() public static method

Build a new light model from model id
public static build ( string $modelId ) : AbstractLightModel
$modelId string Model id
return AbstractLightModel Light model
 /**
  * Test:: Getting known model
  *
  * @covers \Phue\LightModel\LightModelFactory::build
  */
 public function testGetKnownModel()
 {
     $this->assertInstanceOf('\\Phue\\LightModel\\ModelLst001', LightModelFactory::build('LST001'));
 }
Example #2
0
 /**
  * Get model
  *
  * @return AbstractLightModel Light model
  */
 public function getModel()
 {
     return LightModelFactory::build($this->getModelId());
 }