Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix writing to objects example
  • Loading branch information
iulyanp committed Apr 2, 2017
commit 0ab59ab28f95ba55457cc457cc4227d894cb735d
4 changes: 2 additions & 2 deletions components/property_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ can use setters, the magic ``__set()`` method or properties to set values::
{
public $firstName;
private $lastName;
private $children = array();
public $children = array();

public function setLastName($name)
public function getLastName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this change. This section is about modifying objects not reading from them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks better.

{
$this->lastName = $name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should change this to return $this->lastName; then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

}
Expand Down