-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathPurgingModelInterface.php
93 lines (81 loc) · 1.88 KB
/
PurgingModelInterface.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
namespace Esensi\Model\Contracts;
/**
* Purging Model Interface.
*
*/
interface PurgingModelInterface
{
/**
* Get the purgeable attributes.
*
* @return array
*/
public function getPurgeable();
/**
* Set the purgeable attributes.
*
* @param array $attributes to purge
*/
public function setPurgeable(array $attributes);
/**
* Add an attribute to the purgeable array.
*
* @example addPurgeable( string $attribute, ... )
*
* @param string $attribute to purge
*/
public function addPurgeable($attribute);
/**
* Remove an attribute from the purgeable array.
*
* @example removePurgeable( string $attribute, ... )
*
* @param string $attribute to purge
*/
public function removePurgeable($attribute);
/**
* Merge an array of attributes with the purgeable array.
*
* @param array $attributes to purge
*/
public function mergePurgeable(array $attributes);
/**
* Returns whether or not the model will purge
* attributes before saving.
*
* @return bool
*/
public function getPurging();
/**
* Set whether or not the model will purge attributes
* before saving.
*
* @param bool
*/
public function setPurging($value);
/**
* Returns whether the attribute is purgeable.
*
* @param string $attribute name
*
* @return bool
*/
public function isPurgeable($attribute);
/**
* Unset attributes that should be purged.
*/
public function purgeAttributes();
/**
* Save with purging even if purging is disabled.
*
* @return bool
*/
public function saveWithPurging();
/**
* Save without purging even if purging is enabled.
*
* @return bool
*/
public function saveWithoutPurging();
}