xref: /plugin/davcal/vendor/sabre/dav/lib/DAV/IMoveTarget.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAV;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehler/**
6*a1a3b679SAndreas Boehler * By implementing this interface, a collection can effectively say "other
7*a1a3b679SAndreas Boehler * nodes may be moved into this collection".
8*a1a3b679SAndreas Boehler *
9*a1a3b679SAndreas Boehler * The benefit of this, is that sabre/dav will by default perform a move, by
10*a1a3b679SAndreas Boehler * tranfersing an entire directory tree, copying every collection, and deleting
11*a1a3b679SAndreas Boehler * every item.
12*a1a3b679SAndreas Boehler *
13*a1a3b679SAndreas Boehler * If a backend supports a better optimized move operation, this can trigger
14*a1a3b679SAndreas Boehler * some huge speed gains.
15*a1a3b679SAndreas Boehler *
16*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
17*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
18*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
19*a1a3b679SAndreas Boehler */
20*a1a3b679SAndreas Boehlerinterface IMoveTarget extends ICollection {
21*a1a3b679SAndreas Boehler
22*a1a3b679SAndreas Boehler    /**
23*a1a3b679SAndreas Boehler     * Moves a node into this collection.
24*a1a3b679SAndreas Boehler     *
25*a1a3b679SAndreas Boehler     * It is up to the implementors to:
26*a1a3b679SAndreas Boehler     *   1. Create the new resource.
27*a1a3b679SAndreas Boehler     *   2. Remove the old resource.
28*a1a3b679SAndreas Boehler     *   3. Transfer any properties or other data.
29*a1a3b679SAndreas Boehler     *
30*a1a3b679SAndreas Boehler     * Generally you should make very sure that your collection can easily move
31*a1a3b679SAndreas Boehler     * the move.
32*a1a3b679SAndreas Boehler     *
33*a1a3b679SAndreas Boehler     * If you don't, just return false, which will trigger sabre/dav to handle
34*a1a3b679SAndreas Boehler     * the move itself. If you return true from this function, the assumption
35*a1a3b679SAndreas Boehler     * is that the move was successful.
36*a1a3b679SAndreas Boehler     *
37*a1a3b679SAndreas Boehler     * @param string $targetName New local file/collection name.
38*a1a3b679SAndreas Boehler     * @param string $sourcePath Full path to source node
39*a1a3b679SAndreas Boehler     * @param INode $sourceNode Source node itself
40*a1a3b679SAndreas Boehler     * @return bool
41*a1a3b679SAndreas Boehler     */
42*a1a3b679SAndreas Boehler    function moveInto($targetName, $sourcePath, INode $sourceNode);
43*a1a3b679SAndreas Boehler
44*a1a3b679SAndreas Boehler}
45