forked from parse-community/parse-php-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeleteOperation.php
More file actions
executable file
·47 lines (43 loc) · 1.12 KB
/
Copy pathDeleteOperation.php
File metadata and controls
executable file
·47 lines (43 loc) · 1.12 KB
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
<?php
namespace Parse\Internal;
/**
* Class DeleteOperation - FieldOperation to remove a key from an object.
*
* @author Fosco Marotto <fjm@fb.com>
*/
class DeleteOperation implements FieldOperation
{
/**
* Returns an associative array encoding of the current operation.
*
* @return array Associative array encoding the operation.
*/
public function _encode()
{
return ['__op' => 'Delete'];
}
/**
* Applies the current operation and returns the result.
*
* @param mixed $oldValue Value prior to this operation.
* @param mixed $object Unused for this operation type.
* @param string $key Key to remove from the target object.
*
* @return null
*/
public function _apply($oldValue, $object, $key)
{
return;
}
/**
* Merge this operation with a previous operation and return the result.
*
* @param FieldOperation $previous Previous operation.
*
* @return FieldOperation Always returns the current operation.
*/
public function _mergeWithPrevious($previous)
{
return $this;
}
}