Evaluates if field value is required or not
@param $field string
@param $value string
@return boolean
976531
private function isRequired($field, $value) {
		
		if(true === isset($this -> required[$field])) {
			
			$empty = true;

			if(true === is_array($value)) {

				foreach($value as $val) {

					if(strlen(trim($val)) > 0) {
						$empty = false;
					}
				}
			}

			if(true === is_string($value) && strlen(trim($value)) > 0) {
				$empty = false;
			}

			if(false === $this -> required[$field] && $empty) {
			    return true;
			}
		}

		return false;
	}
579696
public function getInvalidField($field)
    {
        $value = isset($this->_invalid[$field]) ? $this->_invalid[$field] : null;

        return $value;
    }
426571
protected function parseValue($value, $field = '')
    {
        unset($field);
        if (is_string($value)) {
            $value = strpos($value, ':') === 0 && $this->query->isBind(substr($value, 1)) ? $value : $this->connection->quote($value);
        } elseif (is_array($value)) {
            $value = array_map([$this, 'parseValue'], $value);
        } elseif (is_bool($value)) {
            $value = $value ? '1' : '0';
        } elseif (is_null($value)) {
            $value = 'null';
        }
        return $value;
    }
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

        if ($this->isNullNotAllowed() && is_null($value)) {
            return false;
        }

        return true;
    }
443622
public function requiredWithAll(string $field, $fieldVal, $fields)
    {
        $allHasValue = true;

        foreach ((array)$fields as $name) {
            if (!$this->required($name)) {
                $allHasValue = false;
                break;
            }
        }

        return $allHasValue ? $this->required($field, $fieldVal) : null;
    }
981902
public function check($field, $value = null)
    {
        $element = $this->resolver->resolveForChecking($field, $value);

        if (! $element->isSelected()) {
            $element->click();
        }

        return $this;
    }
1203259
public function assertInputValueIsNot($field, $value)
    {
        PHPUnit::assertNotEquals(
            $value, $this->inputValue($field),
            "Value [{$value}] for the [{$field}] input should not equal the actual value."
        );

        return $this;
    }
434165
protected function validateUrlActive($field, $value)
    {
        foreach (static::$validUrlPrefixes as $prefix) {
            if (\strpos($value, $prefix) !== false) {
                $host = \parse_url(\strtolower($value), PHP_URL_HOST);

                return \checkdnsrr($host, 'A') || \checkdnsrr($host, 'AAAA') || \checkdnsrr($host, 'CNAME');
            }
        }

        return false;
    }
1248034
protected function validateBoolean($value, ValidationField $field) {
        $value = $value === null ? $value : filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
        if ($value === null) {
            $field->addTypeError($value, 'boolean');
            return Invalid::value();
        }

        return $value;
    }
104049
public function rule_required( $key, $value )
	{
		if ( is_null( $value ) )
		{
			return false;
		}
		elseif ( is_string( $value ) && trim( $value ) == '' )
		{
			return false;
		}
		return true;
	}
598353
public function isValid($value, array $fields = []): bool
    {
        $callback = new Callback($this->validation);
        $arguments = $this->getFunctionArguments($callback->getReflection(), $value, $fields);
        return $callback->executeArray($arguments);
    }
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }
502933
public function contains($field, $value)
    {
        if(!$value instanceof Expr\ConditionalExpression) {
            $value = $this->buildPart($value);
        }
        return new Expr\TextComparisonExpression($field, $value, Expr\TextComparisonExpression::CONTAIN);
    }
536600
protected function validateContainsUnique($field, $value)
    {
        if (!\is_array($value)) {
            return false;
        }

        return $value === \array_unique($value, SORT_REGULAR);
    }
407298
public function compareFields($value, $field, $context) {
		if (!isset($context['data'][$field])) {
			return true;
		}
		if ($value === $context['data'][$field]) {
			return true;
		}

		return false;
	}
1154363
public function set($field, $value)
    {
        $client = $this->getClient();

        $client->hset(
            $this->getKey()->getName(),
            $field,
            $value
        );

        // Integer reply, specifically:
        // 1 if field is a new field in the hash and value was set.
        // 0 if field already exists in the hash and the value was updated.

        return true;
    }
154265
public function isRequired($field)
    {
        $parts = explode('.', $field);
        $entity = $this->entity($parts);

        $isNew = true;
        if ($entity instanceof EntityInterface) {
            $isNew = $entity->isNew();
        }

        $validator = $this->_getValidator($parts);
        $fieldName = array_pop($parts);
        if (!$validator->hasField($fieldName)) {
            return false;
        }
        if ($this->type($field) !== 'boolean') {
            return $validator->isEmptyAllowed($fieldName, $isNew) === false;
        }

        return false;
    }