Logs for #cakephp

Page 3 of 34,879, showing 100 records out of 3,487,833 total, starting on record 201, ending on 300

# At Username Text
# May 26th, 20:21 jeremyharris based on your associations, maybe you’re looking for Users->Follower->newEntity
# May 26th, 20:20 cleptric Should be `Users` I guess
# May 26th, 20:19 HenriqueMachado I'm confused with cake3, cake1 was so easy :P
# May 26th, 20:19 HenriqueMachado What i'm doing wrong here? https://pastebin.com/Wg9mh4MH i'M getting: Error: Call to a member function newEntity() on null
# May 26th, 20:06 igreat Please is there anyway I can build the url in a plugin template to link to the webroot of the plugin
# May 26th, 19:59 jeremyharris np
# May 26th, 19:58 HenriqueMachado worked, thanks
# May 26th, 19:57 HenriqueMachado wow
# May 26th, 19:57 jeremyharris capital T
# May 26th, 19:57 jeremyharris joinTable
# May 26th, 19:56 HenriqueMachado any hint?
# May 26th, 19:56 HenriqueMachado argh :/ caking want a table called users_users https://pastebin.com/RF0uLHK0
# May 26th, 19:49 igreat The vendor folder is in my plugin webroot folder
# May 26th, 19:48 igreat Trying to generate a url to a file in my theme. I used `$this->url->build('/vendor/file')` it generates the link, but links it to the webroot of my app and not the plugin
# May 26th, 19:45 igreat Good day guys
# May 26th, 19:43 HenriqueMachado ah.. sure.. thanks
# May 26th, 19:43 jeremyharris HenriqueMachado I believe it was replaced with targetForeignKey
# May 26th, 19:38 HenriqueMachado associationForeignKey was removed on cake3?
# May 26th, 18:56 jeremyharris a better solution might just be saving the raw data and constructing the entities on demand, because what if your validation rules change and suddenly a previously stored entity fails to save?
# May 26th, 18:55 jeremyharris you would store new entities, those are what cake saves as records
# May 26th, 18:55 jeremyharris ok a resultset comes from the DB, not the other way
# May 26th, 18:54 deco without having a previous resultset
# May 26th, 18:53 deco What I want to do is to build a kind of ResultSet Object that I can later save it to the DB. I thought that collections would do this. :slightly_smiling_face:
# May 26th, 18:50 deco Ok. let me put it together...
# May 26th, 18:49 jeremyharris if you can put together a quick pseudo example of what comes in and what you want to do with it it would probably help
# May 26th, 18:49 jeremyharris what was the reason for the collection? is that the “processing”?
# May 26th, 18:48 deco My idea is to create Entities for each dashboard (Queues / Members / Calls), do the processing ans save it to the Database.
# May 26th, 18:47 jeremyharris deco so QueueStatus QueueMember and Call are the entities?
# May 26th, 18:46 jeremyharris HenriqueMachado can you gist your current UsersTable along with the db schema for `users` and your join table?
# May 26th, 18:45 deco @jeremyharris I'm creating a dashboard for the Asterisk PBX. I'm connected to the PBX Socket receiving event messages. There are 3 types of events I'm interested. Queue Status, Queue Members and Calls. The information I receive is not 1 to 1 to the entities. I have to do some processing before saving.
# May 26th, 18:41 HenriqueMachado cake still looking to the Followers table :/
# May 26th, 18:32 jeremyharris might be a better solution if collections aren’t doing what you want
# May 26th, 18:31 jeremyharris deco what are you trying to accomplish?
# May 26th, 18:22 chris-andre I have a list of users. Does anyone have a tips how I can show useravatar when a:hover?
# May 26th, 18:15 deco Is there anyway I can make a collection of entities to be searchable?
# May 26th, 18:04 HenriqueMachado Ok.. i'll try
# May 26th, 17:56 deco @HenriqueMachado An example of the belongsTo declaration: In my AgentsTable.php I got this: $this->belongsToMany('Queues', ['foreignKey' => 'agent_id','through' => 'AgentsQueues',]); At the Queues Table I have a similiar declaration and in the linker table I have a hasMany to both tables.
# May 26th, 17:51 deco Ok. In a another script I made I thought I was working with collections because I ->appended an Entity to the ResultSet and somehow I though I got a collection when appending info to the ResultSet. I just tried to reproduce yesterdays result but now it's giving me a resultset object (can't remember what I did)....
# May 26th, 17:46 HenriqueMachado i'll read about through
# May 26th, 17:43 HenriqueMachado oh
# May 26th, 17:42 deco @HenriqueMachado try adding the "'through' => 'your linker table'" to the belongsTo variable.
# May 26th, 17:42 jfranger So you would need to pass the collection an array of entities, because it assumes that the object you are passing in is iterable.
# May 26th, 17:42 jfranger Collection is a class that's meant to handle a lot of the work of manipulating collections of things. It operates on an object that is traversable (like an array), or something that implements that interface.
# May 26th, 17:40 deco Hi, I'm getting a little confused with the Collection Class. I'm trying to append an Entity to it the same way I do with a ResultSet Object and it is throwing an Exception (Only array or \Traversable allowed). Shouldn't the Collection object accept an Entity Object?
# May 26th, 17:38 HenriqueMachado Hello! I'm trying to get a Followers/Following system to work on Cake3 I used to get it working on cake1 but.. i'm stuck now.. somebody can help?: https://pastebin.com/CEnfTws2
# May 26th, 16:46 jeremyharris :slightly_smiling_face:
# May 26th, 16:46 deco @jeremyharris Thanks! Of course, pass it an empty array...
# May 26th, 16:39 jeremyharris or `new Collection([])`
# May 26th, 16:39 jeremyharris deco `collection([])`
# May 26th, 16:38 deco Is it possible to create an empty collection? I would like to declare the collection Object before adding Entities to it because I don't really know which Entity type will be appended first...
# May 26th, 16:26 chris-andre I have replaced logo.png with another logo.png. I have cleared cache. Any idea why logo doesn't change on the website? :S
# May 26th, 15:59 jeremyharris glad I’m not the only ones who think they’re implemented a little oddly :slightly_smiling_face:
# May 26th, 15:56 josh_rodarte Yeah. It is silly though as structure changes are often followed with data changes haha.
# May 26th, 15:56 iqu hmic: Thanks! i got it
# May 26th, 15:52 jeremyharris I guess the thought was “seeding only happens on initial build”
# May 26th, 15:52 jeremyharris seeds often require to be run in a point in time where the database is properly set up, so I don’t see any reason why they aren’t mixed in with the migrations
# May 26th, 15:52 josh_rodarte I agree it would be better.
# May 26th, 15:51 jeremyharris but that’s a nice way of organizing them, which is better than nothing
# May 26th, 15:50 jeremyharris @josh_rodarte I’m was hoping for something more like `bin/cake migrations seed` that could be in a deploy hook and just run un-run seeds. would probably require tracking them like migrations are though
# May 26th, 15:47 josh_rodarte @jeremyharris ```./cake migrations seed --seed=BaseSeed --source=Seeds\0.0.1``` BaseSeed would then directly call seeds in it's folder. I've used this to sort of separate seeds into sets. I will come up with something that separates migrations with the sets eventually... as it is they are kind of disconnected and it can be a problem if I'm doing a full rebuild.
# May 26th, 15:46 iqu like ->contain(['Tags','Mediafiles','Users.id'])
# May 26th, 15:46 iqu in controller?
# May 26th, 15:45 iqu my brain is littlebit slow now..
# May 26th, 15:44 hmic is it Users.id or Orders.id
# May 26th, 15:43 hmic qualify the id
# May 26th, 15:43 iqu hmic: sry, dont understand?
# May 26th, 15:43 hmic iqu, specify the table!
# May 26th, 15:41 iqu any easy fix: Error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in order clause is ambiguous
# May 26th, 15:33 hmic so: conditions => ['Bids.user_id = OtherBids.user_id', ... ] instead of conditions => [ 'Bids.user_id' => 'OtherBids.user_id', ... ] will do.
# May 26th, 15:32 styks1987 ok super thanks
# May 26th, 15:31 hmic but, like i said, you can provide them in one string instead of key => value pairs and it will work
# May 26th, 15:31 hmic there is no option available to do so if you are using the "conditions" array notation IMHO, only when using ->where()
# May 26th, 15:31 hmic you do need to tell the orm that the values in your array are not values but identifiers
# May 26th, 15:30 hmic you do not need to change them
# May 26th, 15:30 hmic it gets them from the schema automatically
# May 26th, 15:29 styks1987 ok, do you know where the default types are defined? I don’t know what type to use? I see examples for integer
# May 26th, 15:26 hmic remember: use leftJoinWith ;-)
# May 26th, 15:26 hmic it's not available if you use the 'conditions' key in a join definition
# May 26th, 15:26 hmic its the second parameter to ->where()
# May 26th, 15:24 styks1987 I don’t see that type int he docs
# May 26th, 15:24 styks1987 hmic: how would I specify no value? I’d like to keep the array
# May 26th, 15:23 styks1987 oh, but it made it a string… yea ok you are right
# May 26th, 15:23 hmic easiest way: just don't do an associative array, but put them like: 'Bids.listing_id = OtherBids.listing_id', ...
# May 26th, 15:23 styks1987 hmic: or is it because I had them in the wrong order? It appears that I am supposed to put the joining table first in conditions?
# May 26th, 15:22 hmic you need to tell the orm that this is no data but identifiers
# May 26th, 15:22 hmic so they get casted to the fitting datatype, thats int. so your strings will all be 0 in the query
# May 26th, 15:22 hmic because you did not tell the orm that these are no values
# May 26th, 15:21 hmic yeah
# May 26th, 15:20 styks1987 http://paste.debian.net/943301/
# May 26th, 15:20 styks1987 looks like something is up with the join. It is filling the conditions with 0
# May 26th, 15:14 styks1987 hmic: I’m copying it from the ->sql() output, might try bin log next
# May 26th, 15:11 hmic that does not make much sense if the generated sql is what you have shwon :-/
# May 26th, 15:11 styks1987 in the orm
# May 26th, 15:11 styks1987 not with the ORM but in regular sequel. I get 3 results for both > and <
# May 26th, 15:10 hmic but only one result?
# May 26th, 15:09 styks1987 that gives me the lowest value
# May 26th, 15:09 hmic you need > OtherBids.amount i guess?
# May 26th, 15:08 styks1987 eventually I need to find listings where matching this information but this test is just a proof that the join works as expected
# May 26th, 15:07 styks1987 hmic: http://paste.debian.net/943260/
# May 26th, 15:06 hmic what does the generated sql look like?