Here is a link to the tutorial that I am referring to.
This seems strange to me…in the view script we have this code:
<?php echo $this->escape($entry->email) ?>
This displays the email address that has been set in the Guestbook model. But the property on the model is $_email and it is protected. We’re not calling $entry->getEmail(); so I don’t understand how this is working or where it is pulling this information. I know that it works, but I just don’t understand how.
If there is no property called
$email, and there is a__getmagic-method in the class, you are going through that one.Indeed, quoting the page you linked to :
To learn more about magic methods in PHP 5, you can read this page of the manual — magic methods are used quite a lot in Zend Framework ; and in other modern Frameworks too, should I add.