I am a little confused here I didn't understand what is this.
I have a
.phtml file in which there is a function say
$this->getArticle() when I print this it show the array of the data's stored in the database.
Then I have a function call like this
$this->getArticle()->getContentHtml() these shows the values which is inside the array as the under the same name as database field i.e
I understand till now.
But in the next line there is another function call like this
$this->getArticle()->getCategories() It is returning the categories inside the my article array. But what I didn't understand is that from where is this
getArticle() calls the value.
I dont have categories as an database field name.
In my class file I have a function defined as
function getArticle() but there is no function named as
Then I checked my model file and there I find the function
getCategories which is actually returning the category values.
So the question is that, in the first two statement the the function is called from the
class file while in the last one the same function
getArticleis calling the model file and the next is the function in this file. how is this happen.
What is the logic behind this I didn't understand the flow here when to get value from model and when from class.