Your IP : 127.0.0.1


Current Path : /home/dev2.destoffenstraat.com/app/code/Bss/Popup/Model/ResourceModel/Popup/
Upload File :
Current File : /home/dev2.destoffenstraat.com/app/code/Bss/Popup/Model/ResourceModel/Popup/Collection.php

<?php
/**
 * BSS Commerce Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://bsscommerce.com/Bss-Commerce-License.txt
 *
 * @category   BSS
 * @package    Bss_Popup
 * @author     Extension Team
 * @copyright  Copyright (c) 2018-2019 BSS Commerce Co. ( http://bsscommerce.com )
 * @license    http://bsscommerce.com/Bss-Commerce-License.txt
 */

namespace Bss\Popup\Model\ResourceModel\Popup;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    /**
     * ID Field Name
     *
     * @var string
     */
    protected $_idFieldName = 'popup_id';

    /**
     * Event prefix
     *
     * @var string
     */
    protected $_eventPrefix = 'bss_popup_popup_collection';

    /**
     * Event object
     *
     * @var string
     */
    protected $_eventObject = 'popup_collection';

    /**
     * Define resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init(\Bss\Popup\Model\Popup::class, \Bss\Popup\Model\ResourceModel\Popup::class);
    }

    /**
     * Get SQL for get record count.
     * Extra GROUP BY strip added.
     *
     * @return \Magento\Framework\DB\Select
     */
    public function getSelectCountSql()
    {
        $countSelect = parent::getSelectCountSql();
        $countSelect->reset(\Zend_Db_Select::GROUP);
        return $countSelect;
    }

    /**
     * Return Aray
     *
     * @param string $valueField
     * @param string $labelField
     * @param array $additional
     * @return array
     */
    protected function _toOptionArray($valueField = 'popup_id', $labelField = 'popup_name', $additional = [])
    {
        return parent::_toOptionArray($valueField, $labelField, $additional);
    }
}