Proxy.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Doctrine\Common\Proxy;
  3. use Closure;
  4. use Doctrine\Persistence\Proxy as BaseProxy;
  5. /**
  6. * Interface for proxy classes.
  7. */
  8. interface Proxy extends BaseProxy
  9. {
  10. /**
  11. * Marks the proxy as initialized or not.
  12. *
  13. * @param bool $initialized
  14. *
  15. * @return void
  16. */
  17. public function __setInitialized($initialized);
  18. /**
  19. * Sets the initializer callback to be used when initializing the proxy. That
  20. * initializer should accept 3 parameters: $proxy, $method and $params. Those
  21. * are respectively the proxy object that is being initialized, the method name
  22. * that triggered initialization and the parameters passed to that method.
  23. *
  24. * @return void
  25. */
  26. public function __setInitializer(?Closure $initializer = null);
  27. /**
  28. * Retrieves the initializer callback used to initialize the proxy.
  29. *
  30. * @see __setInitializer
  31. *
  32. * @return Closure|null
  33. */
  34. public function __getInitializer();
  35. /**
  36. * Sets the callback to be used when cloning the proxy. That initializer should accept
  37. * a single parameter, which is the cloned proxy instance itself.
  38. *
  39. * @return void
  40. */
  41. public function __setCloner(?Closure $cloner = null);
  42. /**
  43. * Retrieves the callback to be used when cloning the proxy.
  44. *
  45. * @see __setCloner
  46. *
  47. * @return Closure|null
  48. */
  49. public function __getCloner();
  50. /**
  51. * Retrieves the list of lazy loaded properties for a given proxy
  52. *
  53. * @return array<string, mixed> Keys are the property names, and values are the default values
  54. * for those properties.
  55. */
  56. public function __getLazyProperties();
  57. }