# ORM, TableLocator and plugins

**URL:** <https://discourse.cakephp.org/t/orm-tablelocator-and-plugins/11131>\
**Category:** Plugins\
**Created:** [April 7, 2023, 1:30pm UTC](https://discourse.cakephp.org/t/orm-tablelocator-and-plugins/11131 "2023-04-07T13:30:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lspaczynski](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lspaczynski](https://discourse.cakephp.org/u/lspaczynski)\
**Post date:** [April 7, 2023, 1:30pm UTC](https://discourse.cakephp.org/t/orm-tablelocator-and-plugins/11131/1 "2023-04-07T13:30:34Z")

</div>

Hello all!

I’m kind a new in CakePHP, last time I’ve used it was more than 10 years ago. Im creating a simple app with 2 plugins, lets call them:

Plugin1  
Plugin2

Both of plugins are using the same database table, lets say Candies, with fields: field1, field2, field3. But - Plugin1 uses only field1 and field2. Plugin2 uses only field2 and field3.

The question is:

should I create a corresponding php model (Entity/Candy, Table/CandiesTable) in root App folder or separately in Plugin1 and Plugin2? In case of second choice, how to configure TableLocator i Plugin1Plugin.php and Plugin2Plugin.php?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 16, 2023, 11:52am UTC](https://discourse.cakephp.org/t/orm-tablelocator-and-plugins/11131/2 "2023-04-16T11:52:15Z")

</div>

You can have multiple table classes which point to the same database table - no matter if its in the base app or in a plugin.

The only important part is how you name those table classes so you can uniquely refer to them.

What you do inside those table classes is up 2 you and can be completely configured how you desire.
