code: public function setAttribute($key, $value)
      {
          if ('id' == $key) {
              $this->setFormId($value);
          }
          return parent::setAttribute($key, $value);
      }
docs: Set Attribute
  
  @param string $key
  @param mixed  $value
  @return \Zend\Form\Element|\Zend\Form\ElementInterface