/
SetInterface.php
55 lines (49 loc) · 1.44 KB
/
SetInterface.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* This file is part of the Totem package
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*
* @copyright Baptiste Clavié <clavie.b@gmail.com>
* @license http://www.opensource.org/licenses/MIT-License MIT License
*/
namespace Totem;
use Totem\AbstractSnapshot;
/**
* Represents a set of changes between two data
*
* @author Baptiste Clavié <clavie.b@gmail.com>
*/
interface SetInterface
{
/**
* Retrieve a property change
*
* @param string $property
*
* @return AbstractChange Set if it is a recursive change,
* Addition if something was added,
* Removal if something it was deleted, or
* Modification otherwise
*/
public function getChange($property);
/**
* Test if the given property has been changed
*
* @param string $property
*
* @return boolean
*/
public function hasChanged($property);
/**
* Calculate the changeset between two snapshots
*
* The two snapshots must be of the same snapshot type
*
* @param AbstractSnapshot $old Old snapshot
* @param AbstractSnapshot $new New snapshot
* @param mixed $id Compare the old and new entries by a given key
*/
public function compute(AbstractSnapshot $old, AbstractSnapshot $new, $id = null);
}