Created
June 1, 2016 08:05
-
-
Save jinkrish/ea8470425ef715a359c889047ee28bd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Author { | |
private $firstName; | |
private $lastName; | |
public function __construct($firstName, $lastName) { | |
$this->firstName = $firstName; | |
$this->lastName = $lastName; | |
} | |
public function getFirstName() { | |
return $this->firstName; | |
} | |
public function getLastName() { | |
return $this->lastName; | |
} | |
} | |
class Question { | |
private $author; | |
private $question; | |
public function __construct($question, $authorFirstName, $authorLastName) { | |
$this->author = new Author($authorFirstName, $authorLastName); | |
$this->question = $question; | |
} | |
public function getAuthor() { | |
return $this->author; | |
} | |
public function getQuestion() { | |
return $this->question; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment