src/FilterRule/FromToDate.php
private function runSimpleQuery($operation, $value)
    {
        $attribute = $this->getAttribute();

        if (!$attribute instanceof ISimple) {
            throw new \RuntimeException('Filtering for time ranges is only possible on simple attributes.');
        }

        return $this->executeRule(new SimpleQuery(
            \sprintf(
                'SELECT id FROM %s WHERE TIME(FROM_UNIXTIME(%s)) %s ?)',
                $attribute->getMetaModel()->getTableName(),
                $attribute->getColName(),
                $operation
            ),
            [$value],
            'id',
            $this->connection
        ));
    }
private function runSimpleQuery($operation, $value)
    {
        $attribute = $this->getAttribute();

        if (!$attribute instanceof ISimple) {
            throw new \RuntimeException('Filtering for time ranges is only possible on simple attributes.');
        }

        return $this->executeRule(new SimpleQuery(
            \sprintf(
                'SELECT id FROM %s WHERE TIME(FROM_UNIXTIME(%s)) %s ?)',
                $attribute->getMetaModel()->getTableName(),
                $attribute->getColName(),
                $operation
            ),
            [$value],
            'id',
            $this->connection
        ));
    }
private function runSimpleQuery ( $ operation , $ value ) { $ attribute = $ this -> getAttribute ( ) ; if ( ! $ attribute instanceof ISimple ) { throw new \ RuntimeException ( 'Filtering for time ranges is only possible on simple attributes.' ) ; } return $ this -> executeRule ( new SimpleQuery ( \ sprintf ( 'SELECT id FROM %s WHERE TIME(FROM_UNIXTIME(%s)) %s ?)' , $ attribute -> getMetaModel ( ) -> getTableName ( ) , $ attribute -> getColName ( ) , $ operation ) , [ $ value ] , 'id' , $ this -> connection ) ) ; }
Run a simple query against the attribute when using time only filtering.

@param string $operation The mathematical operation to use for evaluating.

@param string $value     The value to match against.

@return array|null

@throws \RuntimeException When the attribute is not a simple one.
Run a simple query against the attribute when using time only filtering .