YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/QueryFields/MultiImageField.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%
<?php

namespace App\Conditions\QueryFields;

/**
 * MultiImage Query Field Class.
 *
 * @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>
 */
class MultiImageField extends BaseField
{
    /** {@inheritdoc} */
    public function operatorY(): array
    {
        return ['or',
            [$this->getColumnName() => null],
            ['=', $this->getColumnName(), '[]'],
        ];
    }

    /** {@inheritdoc} */
    public function operatorNy(): array
    {
        return ['and',
            ['not', [$this->getColumnName() => null]],
            ['<>', $this->getColumnName(), '[]'],
        ];
    }
}