Logs for #cakephp

Page 7 of 36,516, showing 100 records out of 3,651,584 total, starting on record 601, ending on 700

# At Username Text
# Feb 15th, 01:08 sebastian.krzewinski. its plugin yes?
# Feb 15th, 01:07 challgren @sebastian.krzewinski. https://github.com/icings/menu works great
# Feb 15th, 01:07 sebastian.krzewinski. Hi, anyone know how to do dynamic menus?
# Feb 14th, 18:35 ricksaccous no problem
# Feb 14th, 17:47 phantomwatson No, you're totally right. I occasionally trick myself into confusing doc comments with type declaration stuff in functional code. Thanks!
# Feb 14th, 17:47 ricksaccous lol
# Feb 14th, 17:46 ricksaccous i actually don't really know all i really know is you have to set the return type for that to go away
# Feb 14th, 17:46 ricksaccous i think that's part of the "method signature"
# Feb 14th, 17:46 phantomwatson Ohh, I was just looking at the doc comment having `void` in it.
# Feb 14th, 17:46 ricksaccous public function setUp(): void
# Feb 14th, 17:45 ricksaccous you have to specify return type to void
# Feb 14th, 17:45 ricksaccous yeah
# Feb 14th, 17:42 phantomwatson Does this error make sense to anyone?
# Feb 14th, 17:08 ndm https://vignette.wikia.nocookie.net/villains/images/a/a8/Karate-Kyle.jpg/revision/latest
# Feb 14th, 16:59 admad @ndm that custom eager loader is ninja level shit :)
# Feb 14th, 16:51 ndm No problem
# Feb 14th, 16:50 lilhermit Thanks again for your time it's appreciated
# Feb 14th, 16:49 lilhermit I don't unfortunately I'll have a think on it
# Feb 14th, 16:46 ndm If you have any other unique identifier at hand, then you could probably workaround it with maybe some manual fiddling
# Feb 14th, 16:45 ndm You're welcome.
# Feb 14th, 16:45 lilhermit Thanks for your help
# Feb 14th, 16:44 lilhermit ok that makes it harder because that data comes from an API
# Feb 14th, 16:43 ndm correct
# Feb 14th, 16:43 lilhermit So I need the primary key in the $data array for the phone numbers?
# Feb 14th, 16:41 ndm There you go, the primary key is missing, the data only holds the phone number. I didn't specify it, but it needs to be present in the data that you want to patch the entities with, otherwise the marshaller has no idea into which entity the passed data needs to be merged.
# Feb 14th, 16:35 lilhermit https://pastebin.com/BhNy26TW
# Feb 14th, 16:30 lilhermit I have the data array and the user before and after patching
# Feb 14th, 16:30 lilhermit Yep just adding to pastebin
# Feb 14th, 16:30 ndm _before_ patching
# Feb 14th, 16:29 ndm I'll belive it when I see it ;) Can you show `debug()` of `$user` and `$data`?
# Feb 14th, 16:28 lilhermit The primary keys are there before the patch but after they are all new entities
# Feb 14th, 16:26 ndm What exactly is the final result in `phone_numbers`? I could imagine that it's missing the primary keys which are required for patching existing entities.
# Feb 14th, 16:26 lilhermit No data is changing but it always marks phone_numbers as dirty and duplicates them
# Feb 14th, 16:25 lilhermit The $data looks like ``` $data = [ 'uuid' => $graphUser->getId(), 'first_name' => $graphUser->getGivenName(), 'last_name' => $graphUser->getSurname(), 'email' => $graphUser->getMail(), 'job_title' => $graphUser->getJobTitle(), 'phone_numbers' => Hash::map($graphUser->getBusinessPhones(),
# Feb 14th, 16:25 slackebot '{n}',function($number) { return ['number' => $number]; }) ];```
# Feb 14th, 16:24 lilhermit Patching like `$user = $this->Users->patchEntity($user, $data);`
# Feb 14th, 16:24 lilhermit sure, I load my entity like ``` $user = $this->Users->find('ByUuid', ['uuid' => $graphUser->getId()]) ->contain(['PhoneNumbers']) ->first();```
# Feb 14th, 16:22 ndm @lilhermit I'm not sure, what does your data and code for patching/saving look like?
# Feb 14th, 16:20 ndm no problem
# Feb 14th, 16:20 sebastian.krzewinski. thanks
# Feb 14th, 16:20 sebastian.krzewinski. now is working :)
# Feb 14th, 16:19 sebastian.krzewinski. i see
# Feb 14th, 16:19 ndm @sebastian.krzewinski. Or wait, in CakePHP 4 it's `$this->disableAutoLayout();` now
# Feb 14th, 16:18 lilhermit @ndm Know anything about my saving with associations issue?
# Feb 14th, 16:17 sebastian.krzewinski. i will check
# Feb 14th, 16:17 ndm In that case you've probably removed the `$this->layout = false;` part in `home.php` file, which is responsible for disabling rendering in a layout.
# Feb 14th, 16:17 sebastian.krzewinski. https://i.imgur.com/pmCMN9h.png
# Feb 14th, 16:15 sebastian.krzewinski. pages/home.php is rendering inside layout/default.php
# Feb 14th, 16:14 sebastian.krzewinski. yes
# Feb 14th, 16:12 ndm By `default.php` do you mean a layout, ie `layout/default.php`?
# Feb 14th, 16:10 sebastian.krzewinski. in "/"
# Feb 14th, 16:10 sebastian.krzewinski. my home.php is looks like was rendering in default.php
# Feb 14th, 16:04 sebastian.krzewinski. i send you pm
# Feb 14th, 16:02 ndm @sebastian.krzewinski. You'll have to provide a little more details as to what exactly you've done, and what exactly the result is, "_2 pages in 1_" could mean all sorts of things.
# Feb 14th, 15:58 sebastian.krzewinski. im little bit confused bec. today i edit my home.php and its looks like 2 pages in 1 ( home and default)
# Feb 14th, 15:57 ndm @val Have you tried a custom (eager) loader as I've suggested? You can do all sorts of crazy things that way: https://gist.github.com/ndm2/b417e3fa683a972e295dc0e24ef515e3
# Feb 14th, 15:57 simon781 Afternoon - I have had a dig through the docs but can't see any obvious pattern for using read replicas - we'd probably be looking at offloading reads to a replica DB for some tables. I know we could hook into before events and switch config but is there support for this?
# Feb 14th, 15:53 sebastian.krzewinski. Hi all
# Feb 14th, 15:52 lilhermit Changing the saveStrategy to replace I don't get duplicates but replacing isn't idea for my solution
# Feb 14th, 15:43 lilhermit Hi I'm trying to save an entity with hasMany associations, it always creates new records. I fetch the record initially with the association then patch it with an array. The associated data is the same but it always shows are new and dirty
# Feb 14th, 14:14 val > A complete SQL query CakePHP can use to fetch associated model records. This should be used in situations that require highly customized results. If a query you’re building requires a reference to the associated model ID, use the special `{$__cakeID__$}` marker in the query. For example, if your Apple model hasMany Orange, the query should look something like this: `SELECT Orange.* from oranges as Orange WHERE Orange.apple_id =
# Feb 14th, 14:14 slackebot {$__cakeID__$};`
# Feb 14th, 14:14 val from 2.x cookbook:
# Feb 14th, 14:13 val @lpj145 It is not clear what you mean. How would you get the same ids in 3.x query builder as they are in `{$__cakeID__$}` in 2.x?
# Feb 14th, 13:22 lpj145 more simple clear and secure.
# Feb 14th, 13:21 lpj145 on finder option you can pass a query builder with really you want...
# Feb 14th, 13:21 lpj145 @val https://api.cakephp.org/3.8/class-Cake.ORM.Table.html#_hasMany
# Feb 14th, 13:17 lpj145 @val have a good way to conditionable contained data.
# Feb 14th, 13:07 val > 'hasMany' => [ > 'ShopCategory' => [ > 'conditions' => [ > 'ShopCategory.id IN ( > SELECT ShopCategoryItem.shop_category_id > FROM shops AS Shop > LEFT JOIN shop_category_items AS ShopCategoryItem > ON ShopCategoryItem.shop_id = Shop.id > WHERE Shop.resource_type = "event" AND Shop.resource_id = {$__cakeID__$} > )', > ], > 'foreignKey' => false, > ], > ],
# Feb 14th, 13:07 val @lorenzo, here is a bit simplified example:
# Feb 14th, 12:56 neon1024 Good thanks :thumbsup:
# Feb 14th, 12:34 lorenzo @val can you explain a bit more? there is no 1:1 way to translate that for cake 3, but in general is easy as cake 3 makes custom association conditions quite easy
# Feb 14th, 12:34 lorenzo @neon1024 thanks! Things are going fine here. How about yourself?
# Feb 14th, 12:32 neon1024 :) Thanks
# Feb 14th, 12:29 storkovo @neon1024 that is cool :) thank you very much - I’m exploring options, Proffer looks sexy :+1:
# Feb 14th, 12:29 dereuromark mentioning works :) Does that work with chuck norris too?
# Feb 14th, 12:27 neon1024 @lorenzo :wave: Hey! Hope all is well with you
# Feb 14th, 12:27 val @lorenzo> Hi, we use `{$__cakeID__$}` in 'conditions' in associations in 2.x. What is the proper way to migrate that to 3.x?
# Feb 14th, 12:27 neon1024 :question:
# Feb 14th, 12:27 lorenzo ?
# Feb 14th, 12:25 val @lorenzo?
# Feb 14th, 12:24 neon1024 I haven’t tried converting pdf to image though. Not sure what library might do that job :)
# Feb 14th, 12:24 neon1024 @storkovo Yeah, that should work :)
# Feb 14th, 12:23 storkovo @neon1024 Hello! I am looking at your Proffer plugin (version for cake 3.x at the moment) - I will need to upload and store pdf files and transform them to image (for preview and other things) - am I right with my assumption that custom “transformClass” is desired way and solution for that, please?
# Feb 14th, 12:22 val Hi, we use `{$__cakeID__$}` in 'conditions' in associations in 2.x. What is the proper way to migrate that to 3.x?
# Feb 14th, 09:45 lpj145 The first filter can't nothing, second try, I can't understand what my consurmer talking ? The problem is not me...
# Feb 14th, 09:43 lpj145 Try add two filter for same filder with different filter type :$
# Feb 14th, 09:43 lpj145 And express is based on concept functional programing
# Feb 14th, 09:42 lpj145 Is a era of typed information, devs, meetups, organization, some people talking about stop use arrays, stop turn code with a breach's
# Feb 14th, 09:40 dereuromark Interesting
# Feb 14th, 09:40 lpj145 @dereuromark yes
# Feb 14th, 09:40 lpj145 Express plugin ia based a group information about api query consulting
# Feb 14th, 09:40 dereuromark You think Search plugin is not easy to use?
# Feb 14th, 09:38 lpj145 Symfony and laravel have a similar concept, and express plugin try to help dev by powerful api softwares
# Feb 14th, 09:35 lpj145 @dereuromark because approachable, broke changes, the existing plugin increase all of new or veterans devs needs to know about cake things, and turn more difficult for devs migrate from other fws, because have a new curve of learning.
# Feb 14th, 09:25 revillosakristianpaol its actually overkill hahaha, but its already on prod so i have no choice hehe :,)
# Feb 14th, 09:24 christianjohn.gss shouldnt that be a little overkill? hehe. did u normalize the table?
# Feb 14th, 09:21 revillosakristianpaol unfortunately yes, its 40 :disappointed_relieved: or more on our table (we have no other choice but to find a solution)
# Feb 14th, 09:20 revillosakristianpaol tested using 40, 45 columns table no response
# Feb 14th, 09:18 revillosakristianpaol i think yes, i also tested it t o other tables with such column size. but when using fewer, it works