# |
Nov 29th 2017, 13:17 |
birdy247 |
but debugging the Permissions table, shows the association in lowercase |
# |
Nov 29th 2017, 13:17 |
hmic |
maybe you make sure you have the correct table object first and the association is available there |
# |
Nov 29th 2017, 13:17 |
birdy247 |
I thought what you suggested |
# |
Nov 29th 2017, 13:16 |
birdy247 |
I am curiours as to why it works with lower case |
# |
Nov 29th 2017, 13:16 |
hmic |
birdy247: it's just a suggestion. sorry if it does not apply to your problem at hand... |
# |
Nov 29th 2017, 13:16 |
birdy247 |
it then says its not associated with the plugin |
# |
Nov 29th 2017, 13:15 |
birdy247 |
hmic that doesnt work |
# |
Nov 29th 2017, 13:15 |
hmic |
now you have the table object - which still has nothing in common with an entity object |
# |
Nov 29th 2017, 13:15 |
hmic |
and it gives you the table object back you ask for |
# |
Nov 29th 2017, 13:14 |
hmic |
the registry holds your table objects, like its name suggests |
# |
Nov 29th 2017, 13:14 |
hmic |
this is it's job! |
# |
Nov 29th 2017, 13:14 |
obinoob |
and thus my doubts |
# |
Nov 29th 2017, 13:14 |
obinoob |
hmic: that object it gives you an easy way for accessing your applications table instances as well... |
# |
Nov 29th 2017, 13:10 |
hmic |
and still, this has nothing in common with an entity too, but can ask a datasource to get you entities, or create ones to pass to a datasource for persisting them |
# |
Nov 29th 2017, 13:10 |
hmic |
it's only purpose is to get you to a table object you ask for |
# |
Nov 29th 2017, 13:09 |
hmic |
the tableregistry is a *registry* |
# |
Nov 29th 2017, 13:09 |
hmic |
ahm? nope! |
# |
Nov 29th 2017, 13:09 |
obinoob |
hmic: never thought much about TableRegistry... they behave much like Entities to my eyes as I tend to use them when I can't use an Entity! I guess I need to read some basics |
# |
Nov 29th 2017, 13:07 |
hmic |
and have absolutely nothing in common with the tableregistry |
# |
Nov 29th 2017, 13:07 |
obinoob |
as book says |
# |
Nov 29th 2017, 13:07 |
hmic |
PluginName.PermissionGroups |
# |
Nov 29th 2017, 13:07 |
obinoob |
hmic: I got that entities represent individual rows or domain objects in your application |
# |
Nov 29th 2017, 13:06 |
birdy247 |
hmic how do you mean? |
# |
Nov 29th 2017, 13:06 |
hmic |
obinoob, you are long enough around i would have thought you got a better understanding on these concepts in the meantime. you can read it up in the book in more detail easily... |
# |
Nov 29th 2017, 13:05 |
hmic |
birdy247: i guess you need the plugin syntax/scope again |
# |
Nov 29th 2017, 13:04 |
obinoob |
hmic: lol |
# |
Nov 29th 2017, 13:04 |
birdy247 |
$event->getSubject()->entity = TableRegistry::get('Permissions')->get($entity->id, ['contain' => ['PermissionGroups']]); |
# |
Nov 29th 2017, 13:04 |
birdy247 |
but this says there is no association |
# |
Nov 29th 2017, 13:04 |
birdy247 |
$event->getSubject()->entity = TableRegistry::get('Permissions')->get($entity->id, ['contain' => ['permissiongroups']]); |
# |
Nov 29th 2017, 13:04 |
birdy247 |
Why would this work |
# |
Nov 29th 2017, 13:04 |
cholthipaul |
previous command like migrate worked, so there isn't problem with my configuration |
# |
Nov 29th 2017, 13:02 |
hmic |
there are no differences, because they have absolutely nothing in common! |
# |
Nov 29th 2017, 13:01 |
obinoob |
hmic: so what are the main differences between TableRegistry and Entity? |
# |
Nov 29th 2017, 13:01 |
cholthipaul |
I got an error while using phinx seed:run, error: "call to a member function execute() on a non-object in PdoAdapter.php line 214 |
# |
Nov 29th 2017, 13:01 |
hmic |
the only object holding data is the entity which corresponds to a single row in your excel example with the fields beeing the columns |
# |
Nov 29th 2017, 12:59 |
hmic |
you can ask it to get you a table object in return |
# |
Nov 29th 2017, 12:59 |
hmic |
the table registry is a registry |
# |
Nov 29th 2017, 12:58 |
obinoob |
hmic: I'm following more slowly... so a Table registry is not an entity can I imagina a TableRegistry as a structure to hold data such as excel columns and rows? |
# |
Nov 29th 2017, 12:56 |
hmic |
you can use multiple tables and entities of course in a controller, to your liking |
# |
Nov 29th 2017, 12:55 |
hmic |
obinoob, a table is a table is a table |
# |
Nov 29th 2017, 12:43 |
obinoob |
hmic: I guess TableRegistry will return a new instance of Table entity right? |