/**
  * Returns the attachments from an object of all configured properties
  *
  * @param array $propertyNames
  * @param AbstractEntity $object
  * @return array
  */
 protected function getObjectAttachments($propertyNames, $object)
 {
     $attachments = [];
     if ($object && $propertyNames !== '' && count($propertyNames) > 0) {
         foreach ($propertyNames as $propertyName) {
             if ($object->_hasProperty($propertyName)) {
                 $attachments = array_merge($attachments, $this->getAttachmentsFromProperty($object, $propertyName));
             }
         }
     }
     return $attachments;
 }