Challenge: Interfaces
Explore how to implement interfaces in PHP by creating a User class and Author and Editor interfaces. Learn to manage user privileges for authorship and editing within an AuthorEditor class. This lesson helps you apply object-oriented principles to handle multiple interfaces and print combined user privileges.
We'll cover the following...
We'll cover the following...
Task
- Create a
Userclass with a protected$usernameproperty and methods that can set and get the$username. - Create an
Authorinterface with two abstract methods that can give the user an array of authorship privileges. The first method issetAuthorPrivileges()with the parameter$array, and