Neos\Flow\Persistence\Generic\Session::isSingleValuedPropertyDirty PHP Method

isSingleValuedPropertyDirty() protected method

Checks the $previousValue against the $currentValue.
protected isSingleValuedPropertyDirty ( string $type, mixed $previousValue, $currentValue ) : boolean
$type string
$previousValue mixed
return boolean
    protected function isSingleValuedPropertyDirty($type, $previousValue, $currentValue)
    {
        switch ($type) {
            case 'integer':
                if ($currentValue === (int) $previousValue) {
                    return false;
                }
                break;
            case 'float':
                if ($currentValue === (double) $previousValue) {
                    return false;
                }
                break;
            case 'boolean':
                if ($currentValue === (bool) $previousValue) {
                    return false;
                }
                break;
            case 'string':
                if ($currentValue === (string) $previousValue) {
                    return false;
                }
                break;
            case 'DateTime':
                if ($currentValue instanceof \DateTimeInterface && $currentValue->getTimestamp() === (int) $previousValue) {
                    return false;
                }
                break;
            default:
                if (is_object($currentValue) && $this->getIdentifierByObject($currentValue) === $previousValue['identifier']) {
                    return false;
                }
                break;
        }
        return true;
    }