# |
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? |
# |
Nov 29th 2017, 12:27 |
admad |
joris_: show your coe |
# |
Nov 29th 2017, 12:24 |
obinoob |
hmic: hi, not sure I guess not much... since it is a request in my case a POST but the problem I'm facing is a totally different scenario I mean I'm using a ConnectionManager transactional since I'm inserting data in multiple tables... can I use different entities in same controller? |
# |
Nov 29th 2017, 12:23 |
hmic |
easier than it sounds ;-) |
# |
Nov 29th 2017, 12:23 |
eax |
That worked, thanks! |
# |
Nov 29th 2017, 12:22 |
eax |
@hmic: Ah ok, thanks! |
# |
Nov 29th 2017, 12:20 |
hmic |
eax: just set the code and the body string in the response you return |
# |
Nov 29th 2017, 12:19 |
eax |
Hey folks - In Cake 3, I need to return a response with error 400, and a string in the body. Can I do that without writing middleware? I need it for one specific request, so middleware feels a little overkill. |
# |
Nov 29th 2017, 12:12 |
joris_ |
I've put it fist in the middlewareQueue |
# |
Nov 29th 2017, 12:11 |
hmic |
joris_: sure it's early enough in your middleware stack to be setup already when the controller runs? :~ |
# |
Nov 29th 2017, 12:09 |
joris_ |
@admad i did that, seems to never reach it |
# |
Nov 29th 2017, 12:06 |
birdy247 |
Essentially, using the CRUD JSON api to save a record, getting the schema from the Plugins model |
# |
Nov 29th 2017, 12:03 |
birdy247 |
but then I get a different error |
# |
Nov 29th 2017, 12:03 |
birdy247 |
public $modelClass = "PermissionsManager.Permissions"; |
# |
Nov 29th 2017, 12:03 |
birdy247 |
I added this to the CRUD Permissions class |
# |
Nov 29th 2017, 12:02 |
birdy247 |
getting closer |
# |
Nov 29th 2017, 12:02 |
birdy247 |
Ah |
# |
Nov 29th 2017, 12:01 |
birdy247 |
I tried that |
# |
Nov 29th 2017, 12:00 |
hmic |
Plugin.Permissions, maybe? |
# |
Nov 29th 2017, 12:00 |
birdy247 |
But Permissions lives in a plugin |
# |
Nov 29th 2017, 12:00 |
birdy247 |
$routes->resources('Permissions'); |
# |
Nov 29th 2017, 12:00 |
birdy247 |
I have added it as a resource to the route |
# |
Nov 29th 2017, 11:59 |
birdy247 |
Schema is not registered for a resource at path ''. |
# |
Nov 29th 2017, 11:59 |
birdy247 |
I get this error |
# |
Nov 29th 2017, 11:59 |
birdy247 |
trying to get a POST request to add a record |