Skip to content

Remove forbidden @author tag from Magento_Catalog (part 1) #36987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Categories tree with checkboxes
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Checkboxes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Category form image field helper
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Helper;

Expand Down Expand Up @@ -39,6 +37,8 @@ public function __construct(
}

/**
* Return the URL
*
* @return bool|string
*/
protected function _getUrl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Adminhtml additional helper block for sort by
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Helper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Adminhtml additional helper block for sort by
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Helper\Sortby;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Adminhtml additional helper block for sort by
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Helper\Sortby;

Expand Down
23 changes: 19 additions & 4 deletions app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Product in category grid
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Tab;

Expand All @@ -21,8 +19,6 @@
class Product extends \Magento\Backend\Block\Widget\Grid\Extended
{
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $_coreRegistry = null;
Expand Down Expand Up @@ -68,6 +64,8 @@ public function __construct(
}

/**
* Initialise the block
*
* @return void
*/
protected function _construct()
Expand All @@ -79,6 +77,8 @@ protected function _construct()
}

/**
* Return the category from the core registry
*
* @return array|null
*/
public function getCategory()
Expand All @@ -87,6 +87,8 @@ public function getCategory()
}

/**
* Add a column filter to the collection
*
* @param Column $column
* @return $this
*/
Expand All @@ -110,13 +112,16 @@ protected function _addColumnFilterToCollection($column)
}

/**
* Prepare the collection
*
* @return Grid
*/
protected function _prepareCollection()
{
if ($this->getCategory()->getId()) {
$this->setDefaultFilter(['in_category' => 1]);
}

$collection = $this->_productFactory->create()->getCollection()->addAttributeToSelect(
'name'
)->addAttributeToSelect(
Expand All @@ -139,20 +144,24 @@ protected function _prepareCollection()
if ($storeId > 0) {
$collection->addStoreFilter($storeId);
}

$this->setCollection($collection);

if ($this->getCategory()->getProductsReadonly()) {
$productIds = $this->_getSelectedProducts();
if (empty($productIds)) {
$productIds = 0;
}

$this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
}

return parent::_prepareCollection();
}

/**
* Prepare the columns
*
* @return Extended
*/
protected function _prepareColumns()
Expand All @@ -170,6 +179,7 @@ protected function _prepareColumns()
]
);
}

$this->addColumn(
'entity_id',
[
Expand Down Expand Up @@ -230,6 +240,8 @@ protected function _prepareColumns()
}

/**
* Return the grid URL
*
* @return string
*/
public function getGridUrl()
Expand All @@ -238,6 +250,8 @@ public function getGridUrl()
}

/**
* Return the selected products
*
* @return array
*/
protected function _getSelectedProducts()
Expand All @@ -247,6 +261,7 @@ protected function _getSelectedProducts()
$products = $this->getCategory()->getProductsPosition();
return array_keys($products);
}

return $products;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Category chooser for Wysiwyg CMS widget
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Category\Widget;

Expand All @@ -27,6 +25,8 @@ class Chooser extends \Magento\Catalog\Block\Adminhtml\Category\Tree
protected $_template = 'Magento_Catalog::catalog/category/widget/tree.phtml';

/**
* Initialise the block
*
* @return void
*/
protected function _construct()
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Catalog/Block/Adminhtml/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
* See COPYING.txt for license details.
*/

/**
* Base block for rendering category and product forms
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml;

use Magento\Backend\Block\Widget\Form\Generic;

/**
* Base block for rendering category and product forms
*/
class Form extends Generic
{
/**
* Prepare the layout
*
* @return void
*/
protected function _prepareLayout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* See COPYING.txt for license details.
*/

/**
* Catalog Custom Options Config Renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Config;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Catalog Custom Options Config Renderer
*/
class DateFieldsOrder extends Field
{
/**
* Return the HTML for this element
*
* @param AbstractElement $element
* @return string
* @SuppressWarnings(PHPMD.NPathComplexity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* See COPYING.txt for license details.
*/

/**
* Catalog Custom Options Config Renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Config;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Catalog Custom Options Config Renderer
*/
class YearRange extends Field
{
/**
* Return the HTML for this element
*
* @param AbstractElement $element
* @return string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

/**
* Catalog fieldset element renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element
{
/**
* Initialize block template
* @var string
*/
protected $_template = 'Magento_Catalog::catalog/form/renderer/fieldset/element.phtml';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Catalog textarea attribute WYSIWYG button
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Helper\Form;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
* See COPYING.txt for license details.
*/

/**
* Textarea attribute WYSIWYG content
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg;

use Magento\Backend\Block\Widget\Form;
use Magento\Backend\Block\Widget\Form\Generic;

/**
* Class Content
* Textarea attribute WYSIWYG content
*
* @deprecated 101.0.8
* @see \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav
Expand Down Expand Up @@ -46,7 +41,8 @@ public function __construct(
}

/**
* Prepare form.
* Prepare the form
*
* Adding editor field to render
*
* @return Form
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Catalog/Block/Adminhtml/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/**
* Catalog manage products block
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

/**
* Adminhtml catalog product attributes block
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Attribute extends \Magento\Backend\Block\Widget\Grid\Container
{
/**
* Initialise the block
*
* @return void
*/
protected function _construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* See COPYING.txt for license details.
*/

/**
* Product attribute add/edit form block
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit;

use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Framework\Data\Form as DataForm;

/**
* Product attribute add/edit form block
*/
class Form extends Generic
{
/**
* Prepare the form
*
* @return $this
*/
protected function _prepareForm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
* See COPYING.txt for license details.
*/

/**
* Product attribute add/edit form main tab
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab;

use Magento\Backend\Block\Template\Context;
Expand All @@ -21,6 +16,8 @@
use Magento\Framework\Registry;

/**
* Product attribute add/edit form main tab
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -58,7 +55,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritDoc
* @return $this
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
Expand Down
Loading