Last active
March 11, 2019 18:08
-
-
Save ajuchacko/feeb5023ccc025d240bae85182a580df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class User { | |
public function listAll() { | |
// This method is used on many classes.eg: Member class | |
} | |
} | |
class Member { | |
private $user; | |
private function user() { | |
if(! $this->user) { | |
$this->user = new User; | |
} | |
return $this->user; | |
} | |
public function list() { | |
return $this->user()->listAll(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment