From ebf13f0fe36f122ffaf35abff46ac74a1f765ecf Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 23 Jan 2016 01:45:27 +0100 Subject: [PATCH] #208 - correcting example for consistent object state/output as per @jbafford review --- docs/lazy-loading-ghost-object.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/lazy-loading-ghost-object.md b/docs/lazy-loading-ghost-object.md index 30afb535e..e0e2b8492 100644 --- a/docs/lazy-loading-ghost-object.md +++ b/docs/lazy-loading-ghost-object.md @@ -106,8 +106,8 @@ $initializer = function ( $initializer = null; // disable initialization // load data and modify the object here - $properties["\0ClassName\0foo"] = 'foo'; - $properties["\0ClassName\0bar"] = 'bar'; + $properties["\0ClassName\0name"] = 'Agent'; + $properties["\0ClassName\0surname"] = 'Smith'; // you may also call methods on the object, but remember that // the constructor was not called yet: @@ -116,7 +116,7 @@ $initializer = function ( return true; // confirm that initialization occurred correctly }; -$instance = $factory->createProxy('MyApp\Customer', $initializer); +$instance = $factory->createProxy(\MyApp\Customer::class, $initializer); ``` You can now simply use your object as before: