-
Notifications
You must be signed in to change notification settings - Fork 29
Added $connection property to class #141
Changes from 2 commits
ac90f7a
6789eb4
7f3808c
5ff88c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper | |
* @param \Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory | ||
* @param \Magento\Framework\App\ResourceConnection $resource | ||
* @param \Magento\Framework\Filesystem $filesystem | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\App\Helper\Context $context, | ||
|
@@ -60,7 +62,6 @@ public function __construct( | |
$this->fileUploader->init(); | ||
$this->fileUploader->setAllowedExtensions($this->getAllowedExtensions()); | ||
$this->fileUploader->removeValidateCallback('catalog_product_image'); | ||
$this->connection = $resource->getConnection('write'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not allowed to remove public properties, because according to PHP Property Visibility: Methods declared without any explicit visibility keyword are defined as public. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah forgot about that. @maxalmonte14 would you be able to add the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I add the property as public with a default null value, or should I leave the implementation as before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add the property without a default and then put this implementation back as it was before. Unless @sidolov thinks best otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, now the |
||
$this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess now we do not need this suppress warning since the connection is being set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.