GeekAustin PHP Class - Session 7

777 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
777
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • GeekAustin PHP Class - Session 7

    1. 1. Beginning PHP Session #7 January 12, 2011 Josh Butts
    2. 2. Agenda• More OOP• Database Object• Update Vanity with Objects
    3. 3. Inheritance• Objects can inherit behavior and default state from other objects• A class that inherits from another class is called a sublcass• When we subclass something, we “extend” it• Subclasses may add or change functionality
    4. 4. PHP’s Single Inheritance• A class may have only one parent class• Any given class can have many subclasses
    5. 5. Single Inheritance Person Student Honors Exchange Student Student
    6. 6. Visibility• Public - anyone can call a method or modify a property• Protected - only this class or subclasses may call the method or modify the property• Private - only this class may modify or call
    7. 7. Why use non-public?• Getters & Setters can inject behavior• Protects unrelated code from changing your state

    ×