public function addIsActiveFilter($date = null)
    {
        $this->addFieldToFilter('is_active', true);

        if ($date == null) {
            $date = $this->date->date('Y-m-d');
        }

        $this->getSelect()
            ->where('from_date is null or from_date <= ?', $date)
            ->where('to_date is null or to_date >= ?', $date);

        return $this;
    }
public function addIsActiveFilter($date = null)
    {
        $this->addFieldToFilter('is_active', true);

        if ($date == null) {
            $date = $this->date->date('Y-m-d');
        }

        $this->getSelect()
            ->where('from_date is null or from_date <= ?', $date)
            ->where('to_date is null or to_date >= ?', $date);

        return $this;
    }
public function addIsActiveFilter ( $ date = null ) { $ this -> addFieldToFilter ( 'is_active' , true ) ; if ( $ date == null ) { $ date = $ this -> date -> date ( 'Y-m-d' ) ; } $ this -> getSelect ( ) -> where ( 'from_date is null or from_date <= ?' , $ date ) -> where ( 'to_date is null or to_date >= ?' , $ date ) ; return $ this ; }
Returns only active optimizers.

@param string $date Date the filter need to be active (UTC).

@return \Smile\ElasticsuiteCatalogOptimizer\Model\ResourceModel\Optimizer\Collection
Returns only active optimizers .