# |
Jul 24th 2017, 19:25 |
jarard |
yes |
# |
Jul 24th 2017, 19:24 |
chrisshick |
Are you using cake 3? |
# |
Jul 24th 2017, 19:24 |
chrisshick |
then a field for the directory |
# |
Jul 24th 2017, 19:23 |
chrisshick |
So, if you have a Links table then there should be a field called 'image' ( this is configureable ) |
# |
Jul 24th 2017, 19:23 |
chrisshick |
Actually, I thought the Proffer plugin uses a field inside your table |
# |
Jul 24th 2017, 19:23 |
jarard |
I need to re-visit it I think |
# |
Jul 24th 2017, 19:21 |
chrisshick |
I thought the Proffer plugin works as a hasOne by default |
# |
Jul 24th 2017, 19:20 |
jarard |
so I kind of hacked it to work with HasMany |
# |
Jul 24th 2017, 19:19 |
jarard |
I couldn't get the Proffer plugin which I am using to upload images to work with HasOne |
# |
Jul 24th 2017, 19:18 |
chrisshick |
Is there a reason you have it as a hasMany? |
# |
Jul 24th 2017, 19:17 |
jarard |
it's actually hasMany but I want to force it to hasOne in this case |
# |
Jul 24th 2017, 19:16 |
chrisshick |
Is this a hasOne association? |
# |
Jul 24th 2017, 19:15 |
jarard |
chrisshick - but how would I know the associated record to be deleted? |
# |
Jul 24th 2017, 19:15 |
jarard |
so once the edit has saved successfuly I would delete the exisiting assoicated record? |
# |
Jul 24th 2017, 19:14 |
chrisshick |
jarard, the afterSave might be better because then you know that the save actually succeed or not. |
# |
Jul 24th 2017, 19:12 |
jarard |
would I use a beforeSave call? |
# |
Jul 24th 2017, 19:10 |
jarard |
I have a Link model which has an associated Image - what is the best way to remove the previously saved Image on the edit action? |
# |
Jul 24th 2017, 18:27 |
aaronc |
Cool cool. mysqldump it is... |
# |
Jul 24th 2017, 18:14 |
jeremyharris |
whereas duplicating the schema in a lockfile is a little more trivial |
# |
Jul 24th 2017, 18:13 |
jeremyharris |
it would need to know all the data that was ever stored, essentially duplicating the db :P |
# |
Jul 24th 2017, 18:12 |
jeremyharris |
no, there is not |
# |
Jul 24th 2017, 18:12 |
aaronc |
Got it, but theres no equivalent of ```bin/cake bake migration_diff NAME``` that also automagically handles row data? |
# |
Jul 24th 2017, 18:10 |
jeremyharris |
you can use the cake orm to play with the data, or phinx which has various helper methods |
# |
Jul 24th 2017, 18:10 |
jeremyharris |
you can modify data in migrations as well. I usually make a separate migration for such cases |
# |
Jul 24th 2017, 18:09 |
aaronc |
So migrations only handles the DB schema? How can I keep database state (rows/data) in sync between development machines? |
# |
Jul 24th 2017, 18:01 |
viraj.khatavkar |
@mikesmoniker @admad Sounds great :thumbsup: |
# |
Jul 24th 2017, 17:18 |
mikesmoniker |
I don’t believe so. |
# |
Jul 24th 2017, 17:17 |
styks1987 |
Does the http\client have something like https://github.com/guzzle/guzzle-services for client service descriptions? |
# |
Jul 24th 2017, 17:16 |
admad |
just make a plugin and share with the community :slightly_smiling_face: |
# |
Jul 24th 2017, 17:16 |
admad |
right, that's unlikely to make it into core. |
# |
Jul 24th 2017, 17:15 |
mikesmoniker |
I’m guessing that’s a little too niche for something in core based my limited observations of how Cake core PRs tend to go. |
# |
Jul 24th 2017, 17:14 |
admad |
i was just about to link to that, @mikesmoniker beat me to it :slightly_smiling_face: |
# |
Jul 24th 2017, 17:14 |
mikesmoniker |
@viraj.khatavkar Looks like what CakeDC did in Mixer was using Symfony/Composer libs: https://github.com/CakeDC/mixer/blob/master/src/Controller/Component/ComposerComponent.php#L79 |
# |
Jul 24th 2017, 17:05 |
viraj.khatavkar |
Would it be a good feature to have something like this in the core - to execute other commands and get them in realtime? |
# |
Jul 24th 2017, 16:59 |
viraj.khatavkar |
Okay, but then I have to catch and echo the output. Anyways, I am now using the Symfony’s Process component to get the output in realtime and echo it to the console. |
# |
Jul 24th 2017, 16:52 |
admad |
Using exec() for eg |
# |
Jul 24th 2017, 16:52 |
admad |
@viraj.khatavkar you can run it just like you would any cli command |
# |
Jul 24th 2017, 16:47 |
viraj.khatavkar |
Is it possible to run other commands like `composer dump-autoload` from a `main` method of shell command? I didn’t find anything in the documentation.. |
# |
Jul 24th 2017, 16:42 |
rudy1976s |
hello is there a way to reset belongToMany relation at runtime ? |
# |
Jul 24th 2017, 16:04 |
hmic |
- this is *not* good practise, but only some lines of code to prove whats wrong. |
# |
Jul 24th 2017, 16:04 |
hmic |
just add global no-cache headers - google! - to your bootstrap.php and see if it's working after clearing your browser cache |