PHP Class Constructors

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    with Leanna Pelham
  • 0:05
    Here's the next challenge.
  • 0:07
    Sometimes I want my ships to be broken.
  • 0:10
    So when a ship comes in, it might be able to fight
  • 0:13
    or it might be under repair.
  • 0:15
    This is a property on a ship.
  • 0:17
    A ship could be under repair or not.
  • 0:21
    So I'll add this as a new private property that has a boolean, which
  • 0:25
    can be true or false.
  • 0:28
    The challenge is that whenever we create our objects inside