# |
Jun 11th 2018, 11:47 |
joopm |
and base url is localhost |
# |
Jun 11th 2018, 11:47 |
joopm |
i use xampp |
# |
Jun 11th 2018, 11:47 |
joopm |
i want to use in conditional association |
# |
Jun 11th 2018, 11:46 |
joopm |
https://thepasteb.in/p/j2hlw88yjgnhP |
# |
Jun 11th 2018, 11:46 |
pedroseco |
question: I made a method that replaces strings from my “Posts” table body field, and altough I’m using it directly on my view() method, I ask if there was a better way on doing this since I have more methods that call my data. Should I be using a method to keep this DRY? |
# |
Jun 11th 2018, 11:46 |
loginews |
File uploaded https://cakesf.slack.com/files/U435V89H8/FB64EH0DC/learning_association.txt / https://slack-files.com/T053DPNCM-FB64EH0DC-36015f6b74 - line 8 above is wrong. What is the right syntax ? Thanks. |
# |
Jun 11th 2018, 11:44 |
pedroseco |
Hi everyone! |
# |
Jun 11th 2018, 11:44 |
lorenzo |
what’s the url you use for your development environment? |
# |
Jun 11th 2018, 11:43 |
lorenzo |
I would say that you should focus on first figuring out why debugkit is not present |
# |
Jun 11th 2018, 11:43 |
lorenzo |
but that is not the issue, I think |
# |
Jun 11th 2018, 11:43 |
lorenzo |
btw, you should use `find('external')`instead of `External` |
# |
Jun 11th 2018, 11:43 |
joopm |
the log file shows this Error: [BadMethodCallException] Unknown finder method "External" |
# |
Jun 11th 2018, 11:42 |
joopm |
the error show exactly to this line $companies = $this->paginate($this->Companies); |
# |
Jun 11th 2018, 11:42 |
lorenzo |
do you see any error about debugkit in the logs? |
# |
Jun 11th 2018, 11:42 |
joopm |
i dont know the reason why it is setup in bootstrap |
# |
Jun 11th 2018, 11:41 |
lorenzo |
why not? |
# |
Jun 11th 2018, 11:41 |
joopm |
debugkit is not avaliable |
# |
Jun 11th 2018, 11:41 |
lorenzo |
what about in debugkit? |
# |
Jun 11th 2018, 11:36 |
joopm |
but can not see anything according too autotables |
# |
Jun 11th 2018, 11:34 |
joopm |
Cake\ORM\Association->attachTo(Object(Cake\ORM\Query), Array) |
# |
Jun 11th 2018, 11:34 |
joopm |
Cake\ORM\Association->find('External', Array) |
# |
Jun 11th 2018, 11:33 |
joopm |
ican see like this :Cake\ORM\Table->find('External', Array) |
# |
Jun 11th 2018, 11:33 |
joopm |
well on the error.log : |
# |
Jun 11th 2018, 11:33 |
joopm |
:lorenzo thank you that you still not gave up |
# |
Jun 11th 2018, 11:31 |
lorenzo |
joopm did you figure out if debukit is giving you a warning about auto tables? |
# |
Jun 11th 2018, 11:23 |
edoreld |
thanks |
# |
Jun 11th 2018, 11:22 |
josbeir |
debug($entity->errors()); |
# |
Jun 11th 2018, 11:19 |
edoreld |
How can I debug a failing form? |
# |
Jun 11th 2018, 11:11 |
edgaras.jan |
sorry i was wrong i used findExternal(as you described) but still error |
# |
Jun 11th 2018, 11:10 |
slackebot |
inputfield is an email and send the correct key/values from client, but I'm curious if there is a way to implement it in the API |
# |
Jun 11th 2018, 11:10 |
ksc |
Hi there, Has anyone an example how to allow login with email or username in the same requestfield? (API context, i don't use the cake views) e.g.: "login": "username" OR "email", "password":"******" It works with "email" and "username" in extra inputfields, but i try to allow both from one inputfield. The Auth component restricts that because it uses directly the requestData which is protected. I could check clientside if the |
# |
Jun 11th 2018, 11:09 |
edgaras.jan |
findExternal, not finderExternal |
# |
Jun 11th 2018, 11:08 |
joopm |
i use public function finderExternal(..){...} |
# |
Jun 11th 2018, 11:08 |
edgaras.jan |
i did exactly as you described but i still get the same error Unknown finder method "External" |
# |
Jun 11th 2018, 11:04 |
edgaras.jan |
> when i tried to use this in the model association 'finder'=>'findExternalCheck' > gives me error Unknown finder method however the function is placed in the ModelTable you need remove 'find' prefix |
# |
Jun 11th 2018, 11:01 |
edgaras.jan |
https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#custom-finder-methods |
# |
Jun 11th 2018, 11:01 |
edgaras.jan |
you need add custom finders in Table class, ex `function findMyFinder()`, then use `->find('myFinder')` or 'finder' => 'myFinder' (no 'find' prefix) |
# |
Jun 11th 2018, 10:55 |
joopm |
where should i exactly define the custome find method |
# |
Jun 11th 2018, 10:54 |
joopm |
maybe i am doing wrong the conditional model association |
# |
Jun 11th 2018, 10:53 |
loginews |
alright. I will go and try all this and get back here if i am stuck. |
# |
Jun 11th 2018, 10:52 |
edgaras.jan |
you can also `$this->Rep01->find()->innerJoinWith(...)`, but you would need define JOIN statement everytime. Now you define relation once in Table, and then use relation name in `contain()` |