Advertisement
helgatheviki

Default approach to extending class

Mar 4th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class WC_Product(){
  2. function __construct( $product ){
  3. // main class stuff
  4. }
  5. }
  6.  
  7. class WC_Product_Simple extends WC_Product() {
  8. function __construct( $product ){
  9. parent::__construct( $product );
  10. }
  11. }
  12.  
  13. class WC_Product_NYP_Simple extends WC_Product_Simple() {
  14. function __construct( $product ){
  15. parent::__construct( $product );
  16. }
  17.  
  18. function nyp_method(){
  19. // something NYP specific
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement