# |
Feb 17th 2020, 08:20 |
conehead |
Yeh, have had a look. Unfortunately random errors showed up for me. Additionally I want to prevent loading all fixtures at all. It is always roughly a total of 40 fixtures I have to load |
# |
Feb 17th 2020, 08:18 |
challgren |
@conehead did you look at https://github.com/FriendsOfCake/fixturize you still gotta put the fixtures in but it doesnt take as long to setup/teardown |
# |
Feb 17th 2020, 08:10 |
conehead |
Oh and I ment I have to load all fixtures and create all tables. Instead of loading 11 fixtures I would prefer to load only 1 fixture (which I actually need) |
# |
Feb 17th 2020, 08:03 |
conehead |
And actually I am not willing to recreate all these tables although I do not need them. Yes, time should not matter when testing. But I prefer to add quite a lot of tests and run them regularly |
# |
Feb 17th 2020, 08:02 |
conehead |
Is there a way to remove associations? I would like to test a behavior on a given table. This table has about 10 associations. Now every time I run the tests, I have to create all 11 tests, although I just want to create an entity just with an id and a name |
# |
Feb 17th 2020, 07:27 |
damiano |
good morning |
# |
Feb 17th 2020, 06:46 |
alexdd55976 |
morning |
# |
Feb 17th 2020, 05:58 |
itamer |
Hi @markstory - they've got a moodle website that needs to validate against my Cake site. It's more complex than that, but essentially they've said they want LDAP or AzureAD. It'd be much easier if they could just make a REST/API style request. |
# |
Feb 17th 2020, 03:03 |
markstory |
oauth2 is another approach that can be differently complex to get going. Knowing more about how the clients need to access the users you have will help in deciding whether or not ldap is a good protocol. |
# |
Feb 17th 2020, 03:01 |
markstory |
@itamer Are the other clients desktop/web or mixed clients? |
# |
Feb 17th 2020, 01:11 |
itamer |
I've got a cake3 site that another site wants to use to authenticate it's users. It's been suggested that LDAP would be good. Has anyone added a layer over their cake database to allow it to be an LDAP server? |
# |
Feb 16th 2020, 21:58 |
challgren |
@cake_baker yes |
# |
Feb 16th 2020, 21:44 |
cake_baker |
Is cake 1.3 considered ancient? |
# |
Feb 16th 2020, 19:02 |
wizardfix |
I thought perhaps so. :) |
# |
Feb 16th 2020, 19:01 |
ndm |
No, the `belongsTo` is enough is all you want is read/save the user via result |
# |
Feb 16th 2020, 19:00 |
wizardfix |
Btw do I actually need both ways associations to make it work? |
# |
Feb 16th 2020, 18:59 |
ndm |
you're welcome |
# |
Feb 16th 2020, 18:58 |
wizardfix |
Brilliant, it works! :,) Thanks a mil' @ndm |
# |
Feb 16th 2020, 18:57 |
ndm |
`added_by` is the foreign key column, not the property name. Unless configured otherwise, the property name for an association is by default the lowercased, underscored variation association alias, either singular (belongsTo/hasOne) or plural (hasMany/belongsToMany), ie `$result->user->name` |
# |
Feb 16th 2020, 18:52 |
slackebot |
[APP/Template/Results/index.ctp, line 55]` Can someone see what I'm missing please? :thinking_face: |
# |
Feb 16th 2020, 18:52 |
slackebot |
->setJoinType('INNER');``` and `UsersTable`: ```$this->hasMany('Results', [ 'foreignKey' => 'added_by', ]);``` and included this in my `ResultsController`'s `index()` method: `$this->paginate = ['contain' => ['Users']];` What happens is that I get an error from referring to ``$result->added_by->name`.` If I omit `->name` it works fine but just shows the id. `Notice (8): Trying to get property 'name' of non-object |
# |
Feb 16th 2020, 18:52 |
wizardfix |
Hi - Using 3.8... :) I have a `Results` table and a `Users` table. Results have an `added_by` field which is a foreign key referencing Users table. I am trying to set up an association so that I can show the user name in the Results table, not just the user id, so `<td><?= h($result->added_by->name) ?></td>.` I've set up associations in the `ResultsTable`: ```$this->belongsTo('Users') ->setForeignKey('added_by') |
# |
Feb 16th 2020, 17:20 |
ricksaccous |
oh ok then |
# |
Feb 16th 2020, 17:19 |
flashios09 |
i know how to do it with cake(just force the response content type to `application/json` ) |
# |
Feb 16th 2020, 17:18 |
ricksaccous |
this is more for cake in general |
# |
Feb 16th 2020, 17:18 |
ricksaccous |
oh sorry i don't know about the crud plugin |
# |
Feb 16th 2020, 17:18 |
ricksaccous |
I think |
# |
Feb 16th 2020, 17:18 |
ricksaccous |
you'd set dataType to json |
# |
Feb 16th 2020, 17:18 |
flashios09 |
@ricksaccous how ? what is the hook that i have to use ? beforeFilter ? beforeRender ? |
# |
Feb 16th 2020, 17:18 |
ricksaccous |
if you are using jquery.ajax |
# |
Feb 16th 2020, 17:17 |
ricksaccous |
@flashios09 yes, just pass the headers in the request and cake will treat it as json |
# |
Feb 16th 2020, 15:49 |
flashios09 |
will output: ```{ "success": true, "data": {...} }``` |
# |
Feb 16th 2020, 15:48 |
flashios09 |
i mean something like this `http://cakeapi.test/posts/1` |
# |
Feb 16th 2020, 15:47 |
flashios09 |
is it possible to display the json on the browser without using the `.json` extension ? |
# |
Feb 16th 2020, 15:46 |
flashios09 |
i’m trying the friendsofcake/crud plugin |
# |
Feb 16th 2020, 15:46 |
flashios09 |
hi |
# |
Feb 16th 2020, 13:48 |
narendravaghela |
anyone has faced this issue? |
# |
Feb 16th 2020, 13:48 |
narendravaghela |
CakePHP 4 - It runs the action twice |
# |
Feb 16th 2020, 13:44 |
admad |
https://github.com/FriendsOfCake/search/releases/tag/6.0.0-beta |
# |
Feb 16th 2020, 13:06 |
damiano |
i do not know, admad you are following this plugin, can it be used? |
# |
Feb 16th 2020, 13:05 |
damiano |
the first do not have ver. 4 branch |