/**
* Set default data onto the property-metadata.
*
* @param PropertyMetadata $propertyMetadata
* @param \DOMXPath $xpath
* @param \DOMNode $propertyNode
*
* @return PropertyMetadata
*/
protected function setDefaultData(PropertyMetadata $propertyMetadata, \DOMXPath $xpath, \DOMNode $propertyNode)
{
if (null !== ($translation = XmlUtil::getValueFromXPath('@list:translation', $xpath, $propertyNode))) {
$propertyMetadata->setTranslation($translation);
}
if (null !== ($type = XmlUtil::getValueFromXPath('@list:type', $xpath, $propertyNode))) {
$propertyMetadata->setType($type);
}
if (null !== ($width = XmlUtil::getValueFromXPath('@list:width', $xpath, $propertyNode))) {
$propertyMetadata->setWidth($width);
}
if (null !== ($minWidth = XmlUtil::getValueFromXPath('@list:min-width', $xpath, $propertyNode))) {
$propertyMetadata->setMinWidth($minWidth);
}
if (null !== ($cssClass = XmlUtil::getValueFromXPath('@list:css-class', $xpath, $propertyNode))) {
$propertyMetadata->setCssClass($cssClass);
}
$propertyMetadata->setDisplay(XmlUtil::getValueFromXPath('@display', $xpath, $propertyNode, PropertyMetadata::DISPLAY_NO));
$propertyMetadata->setSortable(XmlUtil::getBooleanValueFromXPath('@list:sortable', $xpath, $propertyNode, true));
$propertyMetadata->setEditable(XmlUtil::getBooleanValueFromXPath('@list:editable', $xpath, $propertyNode, false));
$propertyMetadata->setFilterType(XmlUtil::getValueFromXPath('@filter-type', $xpath, $propertyNode));
$propertyMetadata->setFilterTypeParameters($this->getFilterTypeParameters($xpath, $propertyNode));
return $propertyMetadata;
}