We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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?



85.5k

$model = new MyModel();

echo $model->getSource();

?



93.7k
Accepted
answer
edited Dec '16

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



1.5k

getSource get the table name while setSource set it.