Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Kaisma Penn-Titley
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Kaisma Penn-Titley
PHP Development Techdegree Graduate 20,208 Points

Sibling Relationships Challenge

Step 1: In the Client.php file, create a new class named "Client" that takes it's initial abilities and attributes from the user class, and DOES NOT have the skills of a Developer class.

Step 2: Add a new Client string property named "company" along with its GETTERS and SETTERS.

Kaisma Penn-Titley
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Kaisma Penn-Titley
PHP Development Techdegree Graduate 20,208 Points

This worked for me

<?php
class Client extends User
{
  private $company = "";

  public function setCompany($str) {
    return $this->company = $str;
  }

  public function getCompany() {
   return $this->company;
  }
?>

1 Answer

I'm not sure what you mean by this worked for me. I tried your code and it didn't work for me. But I got it to work by doing the following:

1) Remove return from the setter. A setter does just that - it sets a value

2) Add a closing bracket at the end for the class