I have a simple question regarding PHP Classes. 

Multiple times I have seen other class-frameworks etc use method calls like. 

```
$post->data->text();

```

I like this functionality, rather than just doing something like this. 

```
$post->dataReturnAsText();

```

But i'm not quite sure how they created this functionality to have perhaps a 'sub-method'? Hope someone can point me in the right direction....