protected function getAttributeFilter()
    {
        if ($this->attributeFilter) {
            return $this->attributeFilter;
        }

        return function ($key, $value) {
            if (in_array($key, $this->getNonScalarAttributes())) {
                return !is_scalar($value);
            }

            if (ends_with($key, '_id') && trim($value) === '') {
                return false;
            }

            return is_scalar($value) || $value instanceof DateTime;
        };
    }
protected function getAttributeFilter()
    {
        if ($this->attributeFilter) {
            return $this->attributeFilter;
        }

        return function ($key, $value) {
            if (in_array($key, $this->getNonScalarAttributes())) {
                return !is_scalar($value);
            }

            if (ends_with($key, '_id') && trim($value) === '') {
                return false;
            }

            return is_scalar($value) || $value instanceof DateTime;
        };
    }
protected function getAttributeFilter ( ) { if ( $ this -> attributeFilter ) { return $ this -> attributeFilter ; } return function ( $ key , $ value ) { if ( in_array ( $ key , $ this -> getNonScalarAttributes ( ) ) ) { return ! is_scalar ( $ value ) ; } if ( ends_with ( $ key , '_id' ) && trim ( $ value ) === '' ) { return false ; } return is_scalar ( $ value ) || $ value instanceof DateTime ; } ; }
Return the internal attribute filter. If none is present, create one.

@return callable

@see self::filterAttributesBy
Return the internal attribute filter . If none is present create one .