Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Get the table name having the model 14 Sep 2017 03:33 #15290

  • vlemos
  • vlemos's Avatar Topic Author
  • Online
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin, I am trying to quickly get the table name "#__foo_users" via the model "User" and can't seem to find it. Can you help? Thanks V

Please Log in or Create an account to join the conversation.

Get the table name having the model 15 Sep 2017 08:43 #15291

Try:
$table= JTable::getInstance('user', 'FooTable');
$name = $table->getTableName();

Not via the model, but the shortest way I think.
The following user(s) said Thank You: vlemos

Please Log in or Create an account to join the conversation.

Last edit: by Romkabouter.

Get the table name having the model 17 Sep 2017 02:00 #15292

  • vlemos
  • vlemos's Avatar Topic Author
  • Online
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Romkabouter, not exactly what I was looking for, but thanks for the reply. Warm regards, V

Please Log in or Create an account to join the conversation.

Get the table name having the model 18 Sep 2017 15:21 #15293

  • vlemos
  • vlemos's Avatar Topic Author
  • Online
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Was to share this for a while, but time was against me.
	$table = $model->getTable();	
	$tablename = $table->getTableName();

Warm regards
v
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Get the table name having the model 20 Sep 2017 09:21 #15300

Ah, you needed it from the model indeed.
Nice one :)

Please Log in or Create an account to join the conversation.

Get the table name having the model 20 Sep 2017 10:59 #15303

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Joomla has a so nice architecture.
Try such thing with Wordpress... lol
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.087 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started