GeekAustin PHP Class - Session 7

  • 516 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
516
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
7
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. Beginning PHP Session #7 January 12, 2011 Josh Butts
  • 2. Agenda• More OOP• Database Object• Update Vanity with Objects
  • 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. PHP’s Single Inheritance• A class may have only one parent class• Any given class can have many subclasses
  • 5. Single Inheritance Person Student Honors Exchange Student Student
  • 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. Why use non-public?• Getters & Setters can inject behavior• Protects unrelated code from changing your state