Chris@0
|
1 <?php
|
Chris@0
|
2 /*
|
Chris@0
|
3 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Chris@0
|
4 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
Chris@0
|
5 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
Chris@0
|
6 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
Chris@0
|
7 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
Chris@0
|
8 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
Chris@0
|
9 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
Chris@0
|
10 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
Chris@0
|
11 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
Chris@0
|
12 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
Chris@0
|
13 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Chris@0
|
14 *
|
Chris@0
|
15 * This software consists of voluntary contributions made by many individuals
|
Chris@0
|
16 * and is licensed under the MIT license. For more information, see
|
Chris@0
|
17 * <http://www.doctrine-project.org>.
|
Chris@0
|
18 */
|
Chris@0
|
19
|
Chris@0
|
20 namespace Doctrine\Common\Proxy;
|
Chris@0
|
21
|
Chris@0
|
22 use Closure;
|
Chris@0
|
23 use Doctrine\Common\Persistence\Proxy as BaseProxy;
|
Chris@0
|
24
|
Chris@0
|
25 /**
|
Chris@0
|
26 * Interface for proxy classes.
|
Chris@0
|
27 *
|
Chris@0
|
28 * @author Roman Borschel <roman@code-factory.org>
|
Chris@0
|
29 * @author Marco Pivetta <ocramius@gmail.com>
|
Chris@0
|
30 * @since 2.4
|
Chris@0
|
31 */
|
Chris@0
|
32 interface Proxy extends BaseProxy
|
Chris@0
|
33 {
|
Chris@0
|
34 /**
|
Chris@0
|
35 * Marks the proxy as initialized or not.
|
Chris@0
|
36 *
|
Chris@0
|
37 * @param boolean $initialized
|
Chris@0
|
38 *
|
Chris@0
|
39 * @return void
|
Chris@0
|
40 */
|
Chris@0
|
41 public function __setInitialized($initialized);
|
Chris@0
|
42
|
Chris@0
|
43 /**
|
Chris@0
|
44 * Sets the initializer callback to be used when initializing the proxy. That
|
Chris@0
|
45 * initializer should accept 3 parameters: $proxy, $method and $params. Those
|
Chris@0
|
46 * are respectively the proxy object that is being initialized, the method name
|
Chris@0
|
47 * that triggered initialization and the parameters passed to that method.
|
Chris@0
|
48 *
|
Chris@0
|
49 * @param Closure|null $initializer
|
Chris@0
|
50 *
|
Chris@0
|
51 * @return void
|
Chris@0
|
52 */
|
Chris@0
|
53 public function __setInitializer(Closure $initializer = null);
|
Chris@0
|
54
|
Chris@0
|
55 /**
|
Chris@0
|
56 * Retrieves the initializer callback used to initialize the proxy.
|
Chris@0
|
57 *
|
Chris@0
|
58 * @see __setInitializer
|
Chris@0
|
59 *
|
Chris@0
|
60 * @return Closure|null
|
Chris@0
|
61 */
|
Chris@0
|
62 public function __getInitializer();
|
Chris@0
|
63
|
Chris@0
|
64 /**
|
Chris@0
|
65 * Sets the callback to be used when cloning the proxy. That initializer should accept
|
Chris@0
|
66 * a single parameter, which is the cloned proxy instance itself.
|
Chris@0
|
67 *
|
Chris@0
|
68 * @param Closure|null $cloner
|
Chris@0
|
69 *
|
Chris@0
|
70 * @return void
|
Chris@0
|
71 */
|
Chris@0
|
72 public function __setCloner(Closure $cloner = null);
|
Chris@0
|
73
|
Chris@0
|
74 /**
|
Chris@0
|
75 * Retrieves the callback to be used when cloning the proxy.
|
Chris@0
|
76 *
|
Chris@0
|
77 * @see __setCloner
|
Chris@0
|
78 *
|
Chris@0
|
79 * @return Closure|null
|
Chris@0
|
80 */
|
Chris@0
|
81 public function __getCloner();
|
Chris@0
|
82
|
Chris@0
|
83 /**
|
Chris@0
|
84 * Retrieves the list of lazy loaded properties for a given proxy
|
Chris@0
|
85 *
|
Chris@0
|
86 * @return array Keys are the property names, and values are the default values
|
Chris@0
|
87 * for those properties.
|
Chris@0
|
88 */
|
Chris@0
|
89 public function __getLazyProperties();
|
Chris@0
|
90 }
|