Skip to content

Instantly share code, notes, and snippets.

@alexweissman
Created January 20, 2017 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexweissman/1862ee4970956345a94373c6c807cbe5 to your computer and use it in GitHub Desktop.
Save alexweissman/1862ee4970956345a94373c6c807cbe5 to your computer and use it in GitHub Desktop.
<?php
// suppose class FancyPost extends Post
// Do things using the Post class
$myPost = new Post();
Post::doSomething();
// Override
Post::mapClass('FancyPost');
// Now these statements will use FancyPost instead of Post
$myFancyPost = new Post();
Post::doSomething();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment