Php Magento 2-标量扩展属性未保存

Php Magento 2-标量扩展属性未保存,php,magento2,Php,Magento2,我一直在读Magento的文档,我一直在为更复杂的数据结构使用扩展属性,但我基本上想添加一个简单的标量属性 <extension_attributes for="Magento\Sales\Api\Data\ShipmentTrackInterface"> <attribute code="track_url" type="string"/> </extension_attributes&g

我一直在读Magento的文档,我一直在为更复杂的数据结构使用扩展属性,但我基本上想添加一个简单的标量属性

  <extension_attributes for="Magento\Sales\Api\Data\ShipmentTrackInterface">
    <attribute code="track_url" type="string"/>
  </extension_attributes>
代码生成正确,没有错误,但当我试图检索它时,它实际上不会返回任何内容

$track->getExtensionAttributes()->getTrackUrl()
那我是不是误解了扩展属性?这是否意味着我将始终需要向数据库添加新的内容,即使对于标量类型也是如此

$track->getExtensionAttributes()->getTrackUrl()