protected function addAttributes(\DOMElement $element, ItemFieldInterface $field, ItemInterface $item = null)
    {
        foreach ($field->getAttributes() as $key => $value) {
            if ($item) {
                $key = method_exists($item, $key) ? call_user_func([$item, $key]) : $key;
                $value = method_exists($item, $value) ? call_user_func([$item, $value]) : $value;
            }

            $element->setAttribute($key, $value);
        }
    }
protected function addAttributes(\DOMElement $element, ItemFieldInterface $field, ItemInterface $item = null)
    {
        foreach ($field->getAttributes() as $key => $value) {
            if ($item) {
                $key = method_exists($item, $key) ? call_user_func([$item, $key]) : $key;
                $value = method_exists($item, $value) ? call_user_func([$item, $value]) : $value;
            }

            $element->setAttribute($key, $value);
        }
    }
protected function addAttributes ( \ DOMElement $ element , ItemFieldInterface $ field , ItemInterface $ item = null ) { foreach ( $ field -> getAttributes ( ) as $ key => $ value ) { if ( $ item ) { $ key = method_exists ( $ item , $ key ) ? call_user_func ( [ $ item , $ key ] ) : $ key ; $ value = method_exists ( $ item , $ value ) ? call_user_func ( [ $ item , $ value ] ) : $ value ; } $ element -> setAttribute ( $ key , $ value ) ; } }
Add field attributes to a DOM element.

@param \DOMElement        $element A XML DOM element
@param ItemFieldInterface $field   A feed field instance
@param ItemInterface|null $item    A feed item instance
Add field attributes to a DOM element .