# |
Jul 1st 2019, 08:50 |
conehead |
Can you try ``` $this->hasMany('YourModel') ->setTable('YourTable'); ``` |
# |
Jul 1st 2019, 08:50 |
ndm |
Use the `className` option if your class resides outside the conventions. The `targetTable` option is for "edge cases", for example when you need to build the association dynamically based on already constructed table objects. |
# |
Jul 1st 2019, 08:48 |
mw_fingoweb |
@conehead: I know it's not documented in Web docs, but I have found it in PHPDoc comment above the function :D |
# |
Jul 1st 2019, 08:47 |
conehead |
mw_fingoweb: targetTable is not a valid key. Check https://book.cakephp.org/3.0/en/orm/associations.html#hasmany-associations |
# |
Jul 1st 2019, 08:47 |
mw_fingoweb |
jtraulle: generally it sould be possible to use this key with value that will continue with 'default' behavior |
# |
Jul 1st 2019, 08:46 |
jtraulle |
@ra7bi : https://book.cakephp.org/3.0/en/controllers/request-response.html#setting-the-body |
# |
Jul 1st 2019, 08:45 |
ra7bi |
how i can return entire html in response ? |
# |
Jul 1st 2019, 08:41 |
jtraulle |
mw_fingoweb: Explain with the real tables names because it is not clear to me ;) |
# |
Jul 1st 2019, 08:40 |
blancessanchez30 |
Good day, does anyone here tried PHPUnit in cakephp with checking sessions? :slightly_smiling_face: |
# |
Jul 1st 2019, 08:38 |
mw_fingoweb |
I know, it's simplified problem as I mentioned, I have my table class in different namespace and I need 'targetTable' option |
# |
Jul 1st 2019, 08:37 |
jtraulle |
mw_fingoweb: You should be good without specifying targetTable key ;) |
# |
Jul 1st 2019, 08:34 |
neon1024 |
Morning all |
# |
Jul 1st 2019, 08:29 |
mw_fingoweb |
Is this proper way of use targetTable ? It isn't documented, only in PHPDoc |
# |
Jul 1st 2019, 08:28 |
mw_fingoweb |
This code makes endless loop and stackoverflow because of endless creating instance of each other object |
# |
Jul 1st 2019, 08:26 |
mw_fingoweb |
Like here: https://pastebin.com/JFnYqwHP |
# |
Jul 1st 2019, 08:26 |
mw_fingoweb |
And I want to use 'targetTable' option to select instance of table |
# |
Jul 1st 2019, 08:24 |
mw_fingoweb |
I will simplify problem, I have 2 models, Users and Offers, User hasMany Offers and Offer belongsTo User |
# |
Jul 1st 2019, 08:23 |
mw_fingoweb |
Hello, I have some problem with CakePHP 3.8 ORM. I'm not sure if it is bug or I'm wrong but it seems me bugged. Can you tell me if this is bug or I'm using this wrong. |
# |
Jul 1st 2019, 06:33 |
conehead |
Yes sure. Should be possible: https://stackoverflow.com/questions/33129651/access-web-server-on-virtualbox-vagrant-machine-from-host-browser |
# |
Jul 1st 2019, 06:31 |
drailanjohn.gss |
Thank you, @conehead Is there any other options? like for example I can connect on the database of the vagrant machine via sequel pro? Could I just change the configs of my cakephp app that is running on docker? |
# |
Jul 1st 2019, 06:25 |
conehead |
https://stackoverflow.com/questions/48507357/access-vagrant-vms-from-inside-docker-container |
# |
Jul 1st 2019, 06:25 |
conehead |
Sure |
# |
Jul 1st 2019, 06:22 |
drailanjohn.gss |
hello, I just want to ask, I have a cakephp running on docker, I need to connect it to a database that is hosted on a vagrant server, can I actually do that? |
# |
Jul 1st 2019, 05:23 |
conehead |
Haven't read everything up there tbh |
# |
Jul 1st 2019, 05:23 |
conehead |
Ah well. It connects with ssh and then performs a git pull. Seems like it is not what you were looking for ;) |
# |
Jul 1st 2019, 05:18 |
chrisshick |
@conehead I have actually. We’ve tested it our in dev environments. It however, is still pushed based |
# |
Jul 1st 2019, 05:07 |
conehead |
Ah. Thought it was the other way around |
# |
Jul 1st 2019, 05:06 |
ra7bi |
seems the answer is `WWW_ROOT./dir` |
# |
Jul 1st 2019, 05:03 |
ra7bi |
i tried webroot object but it seems not working |
# |
Jul 1st 2019, 05:03 |
ra7bi |
i need to know how i can include the file stored in webroot of my project in to my plugin source file . |
# |
Jul 1st 2019, 05:02 |
conehead |
@ra7bi can't you create a symlink from that file to your webroot folder? |
# |
Jul 1st 2019, 05:01 |
ra7bi |
:confounded: i want to include ttf font from my plugin file |
# |
Jul 1st 2019, 04:59 |
conehead |
@chrisshick Have you taken a look at Deployer? https://deployer.org/ I am currently testing it (for dev/stage so far) and I am quite happy with the results. Even comes with cakephp support |
# |
Jul 1st 2019, 04:56 |
niel45 |
@ra7bi, should be possible, not sure it is wise though. path would be something like ../../../../../filename |
# |
Jul 1st 2019, 04:53 |
ra7bi |
how would be the path looks like |
# |
Jul 1st 2019, 04:53 |
ra7bi |
is it possible to access a file stored in `root/webroot` from `vendor/pluginName/src/file.php ` ? |
# |
Jul 1st 2019, 04:53 |
niel45 |
what version of Cake? I don't recognise your heirarchy. |
# |
Jul 1st 2019, 04:35 |
slackebot |
<hollistergraham123> |
# |
Jul 1st 2019, 04:33 |
hollistergraham123 |
They are both spelled correctly |
# |
Jul 1st 2019, 04:33 |
hollistergraham123 |
I did. |
# |
Jul 1st 2019, 04:31 |
niel45 |
make sure they what they're supposed to be |