Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to know the table name from the Model instance?

How to know the table name from the Model instance?



60.9k
$model = new MyModel();

echo $model->getSource();

?



62.7k
Accepted
answer
edited Dec '16

Use the getSource() method. More info and methods from https://docs.phalconphp.com/en/3.0.1/api/Phalcon_Mvc_Model.html.



516

getSource get the table name while setSource set it.