We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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.