/**
  * @param PropertyType $propertyType
  * @param string $id
  * @param array $propertyValues
  * @return PropertyBoolean|PropertyDateTime|PropertyDecimal|PropertyHtml|PropertyId|PropertyInteger|PropertyString
  */
 protected function getPropertyByPropertyType(PropertyType $propertyType, $id, array $propertyValues)
 {
     if ($propertyType->equals(PropertyType::cast(PropertyType::STRING))) {
         $property = new PropertyString($id, $this->convertStringValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::ID))) {
         $property = new PropertyId($id, $this->convertStringValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::BOOLEAN))) {
         $property = new PropertyBoolean($id, $this->convertBooleanValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::INTEGER))) {
         $property = new PropertyInteger($id, $this->convertIntegerValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::DATETIME))) {
         $property = new PropertyDateTime($id, $this->convertDateTimeValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::DECIMAL))) {
         $property = new PropertyDecimal($id, $this->convertDecimalValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::HTML))) {
         $property = new PropertyHtml($id, $this->convertStringValues($propertyValues));
     } elseif ($propertyType->equals(PropertyType::cast(PropertyType::URI))) {
         $property = new PropertyUri($id, $this->convertStringValues($propertyValues));
     } else {
         // this could only happen if a new property type is added to the enumeration and not implemented here.
         throw new CmisInvalidArgumentException(sprintf('The given property type "%s" could not be converted.', $propertyType));
     }
     return $property;
 }