示例#1
0
 /**
  * {@inheritDoc}
  */
 public static function fromArray($array)
 {
     $variant = new Variant();
     if (isset($array['name'])) {
         $variant->setName($array['name']);
     }
     if (isset($array['filename'])) {
         $variant->setFilename($array['filename']);
     }
     if (isset($array['options'])) {
         $variant->setOptions($array['options']);
     }
     if (isset($array['mode'])) {
         $variant->setMode($array['mode']);
     }
     if (isset($array['status'])) {
         $variant->setStatus($array['status']);
     }
     if (isset($array['error'])) {
         $variant->setError($array['error']);
     }
     if (isset($array['meta']) && is_array($array['meta']) && !empty($array['meta'])) {
         $variant->setMeta($array['meta']);
     }
     return $variant;
 }
 public function testSetGetError()
 {
     $this->object->setError('error');
     $this->assertEquals('error', $this->object->getError());
 }