checkNotNull

Test if given value is null.

@access              private
@param  string       $val
@param  string       $name
@throws \InvalidArgumentException if $val is null
@return RowStructure $this
492955
private function checkNotNull($val, $name)
    {
        if ($val === null) {
            throw new \InvalidArgumentException(sprintf("'%s' cannot be null in '%s'.", $name, get_class($this)));
        }

        return $this;
    }
820279
protected function nullableValue(string $name): Closure
    {
        return function (Table $table) use ($name) {
            assert($table->hasColumn($name));
            $table->getColumn($name)->setNotnull(false);
        };
    }
932701
protected function guardAgainstNull(
        $data,
        $dataName = 'Argument',
        $exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException'
    ) {
        if (null === $data) {
            $message = sprintf('%s cannot be null', $dataName);
            throw new $exceptionClass($message);
        }
    }
228827
public void validateNotNull(Object object, String name) {
        validateNotNull(object, name, messages.get(Validation.NOTNULL_KEY.name(), name));
    }
187068
public static String notEmptyIfNotNull(String value, String name, String info) {
        if (value == null) {
            return value;
        }

        if (value.trim().length() == 0) {
            throw new IllegalArgumentException(name + " cannot be empty" + (info == null ? "" : ", " + info));
        }
        return value.trim();
    }
1063804
public function has($name, $notNull = true)
    {
        $value = NestedArrayUtil::getNestedArrayValue(self::$config, explode('.', $name), $exists);

        return $exists && (!$notNull || $value !== null);
    }
307698
final public function castValue($val)
    {
        if ($this->isEmptyValue($val)) {
            if ($this->required()) {
                throw $this->getValidationException('field is required', $val);
            }

            return null;
        } else {
            $val = $this->validateCastValue($val);
            if (!$this->constraintsDisabled) {
                $validationErrors = $this->checkConstraints($val);
                if (count($validationErrors) > 0) {
                    throw new FieldValidationException($validationErrors);
                }
            }

            return $val;
        }
    }
54860
public function isNull()
    {
        if (!is_null($this->value)) {
            throw new InvalidNullException($this->name, $this->value);
        }

        return $this;
    }
643015
public function raw($name) {
        // TODO: Implement __get() method.
        if (isset($this->row[$name])) { //array_key_exists($name, $this->_row)
            return  $this->row[$name];
        }
        if(isset($this->stack[$name])){
            $this->row = &$this->stack;
            return $this->row[$name];
        }
        return null;
    }
246821
public function addRow($name = NULL)
	{
		/** @noinspection PhpParamsInspection */
		$row = new BootstrapRow($this, $name);
		$this->addComponent($row, $row->name);

		return $row;
	}
517435
public function set($name, $value = null)
	{
		is_null($name) or \Arr::set($this->data, $name, $value);

		return $this;
	}
745644
public function fdSession($name = null, $val = null)
    {
        $fdSession = $this->getAttribute('fdSession');
        switch (count(func_get_args())) {
            case 0:
                return $fdSession;
                break;
            case 1:
                return $fdSession->offsetGet($name);
                break;
            case 2:
                $fdSession->offsetSet($name, $val);
                return $fdSession;
                break;
            default:
                throw new \InvalidArgumentException(sprintf(
                    'Invalid args num "%d"',
                    count(func_get_args())
                ));
                break;
        }
    }
663286
public static <T> void checkEachParameterNotNull(final String name,
                                                     final T... parameters) {
        if (parameters == null) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be not null!");
        }
        for (final Object parameter : parameters) {
            if (parameter == null) {
                throw new IllegalArgumentException("Parameter named '" + name + "' should be not null!");
            }
        }
    }
861604
public static function post( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$_POST[ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return $_POST;
		} else {
			return ( isset( $_POST[ $name ] ) ) ? $_POST[ $name ] : NULL;
		}

	}
332103
public static function post(String $name = NULL, $value = NULL)
    {
        return self::_method($name, $value, $_POST ,__FUNCTION__);
    }
1058140
public function setParam($name, $value): self
    {
        if (null === $name) {
            throw new \InvalidArgumentException('The argument name cannot be null.');
        }

        $this->params[$name] = $value;

        return $this;
    }
570884
public function setParam($name, $val)
    {
        if ( ! is_string($name) || ! is_string($val)) {
            return;
        }
        $this->data[$name] = $val;

        return $this;
    }