| Current Path : /home/rtorresani/www/vendor/magento/module-tax/Model/ResourceModel/TaxClass/ |
| Current File : //home/rtorresani/www/vendor/magento/module-tax/Model/ResourceModel/TaxClass/Collection.php |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Tax class collection
*
* @author Magento Core Team <core@magentocommerce.com>
*/
namespace Magento\Tax\Model\ResourceModel\TaxClass;
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
* Resource initialization
*
* @return void
*/
public function _construct()
{
$this->_init(\Magento\Tax\Model\ClassModel::class, \Magento\Tax\Model\ResourceModel\TaxClass::class);
}
/**
* Add class type filter to result
*
* @param int $classTypeId
* @return $this
*/
public function setClassTypeFilter($classTypeId)
{
return $this->addFieldToFilter('main_table.class_type', $classTypeId);
}
/**
* Retrieve option array
*
* @return array
*/
public function toOptionArray()
{
return $this->_toOptionArray('class_id', 'class_name');
}
/**
* Retrieve option hash
*
* @return array
*/
public function toOptionHash()
{
return $this->_toOptionHash('class_id', 'class_name');
}
}