YetiForceCompany/YetiForceCRM

View on GitHub
modules/Occurrences/models/Field.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
/**
 * Occurrences field object.
 *
 * @package   Model
 *
 * @copyright YetiForce S.A.
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 * @author    Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
 */
/**
 * Occurrences_Field_Model Class.
 */
class Occurrences_Field_Model extends Vtiger_Field_Model
{
    /** {@inheritdoc} */
    public function getValidator()
    {
        $validator = [];
        if ('date_end' === $this->getName()) {
            $funcName = ['name' => 'greaterThanDependentField',
                'params' => ['date_start'], ];
            array_push($validator, $funcName);
        } else {
            $validator = parent::getValidator();
        }
        return $validator;
    }
}