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