File size: 893 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

declare(strict_types=1);

namespace Mautic\CoreBundle\Entity;

/**
 * Optimistic locking is applied for entities that implements this interface.
 */
interface OptimisticLockInterface
{
    /**
     * Returns the current version of the entity.
     */
    public function getVersion(): int;

    /**
     * Sets a new version of the entity and resets the mark for incrementing the version.
     */
    public function setVersion(int $version): void;

    /**
     * Returns true if the entity is marked for incrementing the version in a subsequent flush call.
     */
    public function isMarkedForVersionIncrement(): bool;

    /**
     * Mark the entity for incrementing the version in a subsequent flush call.
     */
    public function markForVersionIncrement(): void;

    /**
     * Returns the name of the version field.
     */
    public function getVersionField(): string;
}