Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Sometimes you have a method that you want to keep, but you just want to add a little more functionality. Once again, PHP gives us a way to keep the original method while still adding additional code.
The Scope Resolution Operator, the double colon (::), is a token that allows access to static, constant, and overridden properties or methods of a class. You can use this operator when Extending the method of a parent class.
parent::__construct($data);
will call the constructor from the parent class. You can then add your own code either before or after the call to the parent method.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up