YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/QueryTraits/Comparison.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
/**
 * Query comparison file.
 *
 * @package UIType
 *
 * @copyright YetiForce S.A.
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 * @author    Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
 */

namespace App\Conditions\QueryTraits;

/**
 * Query comparison class.
 */
trait Comparison
{
    /**
     * Lower operator.
     *
     * @return array
     */
    public function operatorL(): array
    {
        return ['<', $this->getColumnName(), $this->getValue()];
    }

    /**
     * Greater operator.
     *
     * @return array
     */
    public function operatorG(): array
    {
        return ['>', $this->getColumnName(), $this->getValue()];
    }

    /**
     * Lower or equal operator.
     *
     * @return array
     */
    public function operatorM(): array
    {
        return ['<=', $this->getColumnName(), $this->getValue()];
    }

    /**
     * Greater or equal operator.
     *
     * @return array
     */
    public function operatorH(): array
    {
        return ['>=', $this->getColumnName(), $this->getValue()];
    }
}