for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Multi email condition record field class.
*
* @package UIType
* @copyright YetiForce S.A.
* @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
* @author Mariusz Krzaczkowski <[email protected]>
*/
namespace App\Conditions\RecordFields;
class MultiEmailField extends BaseField
{
/** @var string Separator. */
protected $separator = ',';
/** {@inheritdoc} */
public function getValue(): array
$value = [];
if (!empty(parent::getValue()) && \in_array($this->operator, ['e', 'n'])) {
$value = array_map(fn ($email) => $email['e'], \App\Json::decode(parent::getValue()));
}
return $value;
public function operatorE(): bool
return (bool) array_intersect($this->getValue(), explode($this->separator, $this->value));
public function operatorN(): bool
return (bool) !array_intersect($this->getValue(), explode($this->separator, $this->value));
public function operatorC(): bool
return $this->operatorE();
public function operatorK(): bool
return $this->operatorN();