# |
Jun 10th 2018, 07:54 |
birdy247 |
Ah ok |
# |
Jun 10th 2018, 07:54 |
lorenzo |
you can then use $this->loadModel() |
# |
Jun 10th 2018, 07:54 |
lorenzo |
@birdy247 add the `ModelTrait` to your class |
# |
Jun 10th 2018, 07:52 |
birdy247 |
As TableRegistery::get() is depricated, is there a mice way of writing (new TableLocator())->get() |
# |
Jun 10th 2018, 07:14 |
gannher |
When i try to validate data by using "$this->Users->save($user))" no error is print, but there is error when i use "$validator->errors($this->request->getData())" in Controller |
# |
Jun 10th 2018, 07:12 |
gannher |
validationDefault in model is functionnal in cakephp 3.6 ? |
# |
Jun 10th 2018, 07:09 |
gannher |
hello |
# |
Jun 9th 2018, 23:29 |
josexato |
nice, thanks |
# |
Jun 9th 2018, 21:25 |
lorenzo |
the second argument array will be available in the cusotm finder |
# |
Jun 9th 2018, 21:24 |
lorenzo |
`$table->find('customThing', ['extraOption' => $value])` |
# |
Jun 9th 2018, 21:24 |
lorenzo |
yeah, in the second argument of find |
# |
Jun 9th 2018, 21:18 |
josexato |
@lorenzo thanks, I think that's the approach I'll aim. nevertheless I was wondering if there was a way to pass an argument to a custom finder |
# |
Jun 9th 2018, 21:13 |
lorenzo |
you can then do `$submenuTable->find()->contain(‘ChoseDish’, function ($q) { return $q->where([‘available_dish_id’ => ...]); }); |
# |
Jun 9th 2018, 21:12 |
lorenzo |
thta association looks like a `Submenu belongsToMany ChosenDish` |
# |
Jun 9th 2018, 20:59 |
josexato |
i was planing to use a custom finder that receives the ID of the intermediate table `available_dish_id` but I dont know if its possible to pass an argument to the custom finder used in the association "Submenu hasOne ChosenDish" |
# |
Jun 9th 2018, 20:56 |
josexato |
I need to implement an association "Submenu hasOne ChosenDish" |
# |
Jun 9th 2018, 20:50 |
lorenzo |
@josexato I got lost, what’s your actual requirement? |
# |
Jun 9th 2018, 20:27 |
josexato |
File uploaded https://cakesf.slack.com/files/U1QRH4E82/FB4LFTS5R/imagen.png / https://slack-files.com/T053DPNCM-FB4LFTS5R-ed1975b3d0 |
# |
Jun 9th 2018, 20:26 |
josexato |
I need to load the Submenu->ChosenDish() based in the AvailableDish_id I receive |
# |
Jun 9th 2018, 20:25 |
josexato |
my real case is a bit more complicated because it uses an intermediate table SubMenu BelongsToMany Dishes and I am using an intermediate table AvailableDishes |
# |
Jun 9th 2018, 20:20 |
josexato |
just as an example |
# |
Jun 9th 2018, 20:20 |
josexato |
I would like something like Courses->StudentsWithGradeHigherThan('90') |
# |
Jun 9th 2018, 20:18 |
josexato |
for example I have an association Courses has many Students |
# |
Jun 9th 2018, 20:17 |
lorenzo |
how are you calling the custom finder in the association? |
# |
Jun 9th 2018, 20:14 |
josexato |
in the table class i define the custom finder and the association that will use that finder |
# |
Jun 9th 2018, 20:13 |
josexato |
hello how can I pass a variable to a custom finder in an association? |
# |
Jun 9th 2018, 19:52 |
narendravaghela |
use double quotes :slightly_smiling_face: |
# |
Jun 9th 2018, 19:51 |
narendravaghela |
echo $this->Form->control("comments.$i.comment"); |
# |
Jun 9th 2018, 18:48 |
joopm |
echo $this->Form->control('comments.$i.comment');//this seems its does not works |
# |
Jun 9th 2018, 18:48 |
joopm |
how can i use variable insted of that constant 0 ? |
# |
Jun 9th 2018, 18:48 |
joopm |
echo $this->Form->control('comments.0.comment'); |
# |
Jun 9th 2018, 18:48 |
joopm |
if i need to add multiple elements in form(for HBM assoc) |
# |
Jun 9th 2018, 18:47 |
joopm |
hello |
# |
Jun 9th 2018, 09:17 |
madbbb |
@lorenzo thank you! |
# |
Jun 9th 2018, 08:43 |
lorenzo |
@madbbb you can add a beforeDelete fallback on the fly from your test method that returns false |
# |
Jun 9th 2018, 08:15 |
birdy247 |
morning |
# |
Jun 9th 2018, 08:08 |
admad |
@bogdan trying to get 100% coverage is like chasing fool's gold :slightly_smiling_face: |
# |
Jun 9th 2018, 07:47 |
jurrieb |
Anyone at Dutch php conference? |
# |
Jun 9th 2018, 07:05 |
madbbb |
File uploaded https://cakesf.slack.com/files/UAAC8JMM4/FB437445P/image.png / https://slack-files.com/T053DPNCM-FB437445P-ddeb63c1ef - good morning. I'm trying cover my code with 100% coverage and stuck testing delete method failure. How can I test Flash-andgt;error line? Tried to change id of the record, but it stops at get exception. |
# |
Jun 8th 2018, 21:41 |
ricksaccous |
@cnizzardini i've seen people ask that before and i'm not even sure, personally if i work with others i simply don't commit it, but can be a pain not being able to do git add . so it's your call |
# |
Jun 8th 2018, 21:21 |
cnizzardini |
For Cake3 migrations, should schema-dump-default.lock be ignored in git? |