# |
Jul 14th 2017, 14:19 |
awi |
like false? |
# |
Jul 14th 2017, 14:19 |
awi |
If there is something happening in beforemarshall and I want to stop saving this bunch of data, what do I need to return? |
# |
Jul 14th 2017, 14:12 |
neon1024 |
Guess I need to make a whole bunch of exception classes now then |
# |
Jul 14th 2017, 14:07 |
hmic |
like i said: you import it to the current namespace. this is: you create it in your current scope. so you can distinguish it from the others. it's perfectly fine that it's the same thing, you just need to be able to scope it |
# |
Jul 14th 2017, 14:06 |
hmic |
yes |
# |
Jul 14th 2017, 14:06 |
neon1024 |
So it’s about scope |
# |
Jul 14th 2017, 14:06 |
hmic |
you would want to catch only invalid arguments in your current namespace, not things that go wrong somewhere else |
# |
Jul 14th 2017, 14:06 |
neon1024 |
Guess it’s a use-case I’ve not encountered yet |
# |
Jul 14th 2017, 14:06 |
neon1024 |
Not sure why I’d ever want to do that :slightly_smiling_face: |
# |
Jul 14th 2017, 14:06 |
hmic |
exactly |
# |
Jul 14th 2017, 14:05 |
neon1024 |
So you mean I could catch \MyThingy\Exception in a different way to \Exception? |
# |
Jul 14th 2017, 14:05 |
neon1024 |
Sounds like I’ve got a gap in my knowledge here |
# |
Jul 14th 2017, 14:04 |
hmic |
that only works this way |
# |
Jul 14th 2017, 14:04 |
neon1024 |
The only possible reason I can think of is that if you want to change your exception, you don’t need to change it in all the places you’ve implemented it |
# |
Jul 14th 2017, 14:04 |
hmic |
because you might not want to catch any invalid argument in the chain of things, but only the one in your namespace |
# |
Jul 14th 2017, 14:04 |
neon1024 |
I don’t see the point of doing that when \InvalidArgumentException works just fine |
# |
Jul 14th 2017, 14:03 |
hmic |
why you'd do that: import it to the current namespace. |
# |
Jul 14th 2017, 14:03 |
neon1024 |
No, that’s me selecting the root one because I don’t see the point of the others |
# |
Jul 14th 2017, 14:03 |
hmic |
obviously the autocomplete is smart enough to sujggest the current namespace first |
# |
Jul 14th 2017, 14:03 |
neon1024 |
Still doesn’t answer my question. |
# |
Jul 14th 2017, 14:03 |
hmic |
neon1024: yes, you decide the correct namespace to use |
# |
Jul 14th 2017, 14:02 |
neon1024 |
Great @hmic, then you end up here, http://i.imgur.com/3fnP1wp.png |
# |
Jul 14th 2017, 14:02 |
spencdev |
Hmm, I had this same issue myself about 3 days ago. When I created an index for the column it went away |
# |
Jul 14th 2017, 14:02 |
hmic |
additionally, you dont need the joins on the count at all if you do not filter anyways. just drop them! |
# |
Jul 14th 2017, 14:01 |
hmic |
there is going something completely wrong, as 400k records is really not much |
# |
Jul 14th 2017, 14:00 |
hmic |
diego182: check if they get used by telling mysql to explain your queries |
# |
Jul 14th 2017, 14:00 |
hmic |
neon1024: it imports it to the namespace |
# |
Jul 14th 2017, 14:00 |
diego182 |
yes, it does |
# |
Jul 14th 2017, 13:58 |
spencdev |
@diego182 does your table have an index for the joins? |
# |
Jul 14th 2017, 13:52 |
diego182 |
to have a faster query |
# |
Jul 14th 2017, 13:50 |
neon1024 |
I don’t see why you’d do that |
# |
Jul 14th 2017, 13:50 |
neon1024 |
Can anyone tell me why this exists? https://github.com/php-fig/log/blob/master/Psr/Log/InvalidArgumentException.php |
# |
Jul 14th 2017, 13:46 |
slackebot |
have something like this: ``` SELECT ( COUNT(*) ) AS `count` FROM message_board MessageBoard LEFT JOIN users ``` |
# |
Jul 14th 2017, 13:46 |
slackebot |
website, I've tried to make a count with only messages (as its a left join, it would be ok), and the result is much faster, is there somehow generate the count for the paginator component? the query generated query is: ``` SELECT ( COUNT(*) ) AS `count` FROM message_board MessageBoard LEFT JOIN users Users ON Users.id = (MessageBoard.user_id) LEFT JOIN users Friends ON Friends.id = ( MessageBoard.destination_user_id ) ``` What |
# |
Jul 14th 2017, 13:46 |
diego182 |
Hello all, I have a MySQL table with storage Engine InnoDB and it has arround ~400000 records on it, this table is a message table and has 2 fk with the users table, one for origin user, other for destination user, I'm running on PHP 7 and MySQL 5.7, the associations are loaded with LEFT join. My problem is that the count query needed due to pagination is really slow, it takes about something between 5 and 10 seconds to be done, so its slo |
# |
Jul 14th 2017, 13:33 |
neon1024 |
Just an out-loud question really. Is there a convention for indenting return lines in a docblock if the line runs over the character limit of the line. I see some places a single tab indent to show it’s a continuation of the previous line. Anyone have thoughts? |
# |
Jul 14th 2017, 13:28 |
spriz |
I saw some entities was created in the afterSave/beforeSave logic |
# |
Jul 14th 2017, 13:28 |
spriz |
so if somewhere in the before/after save of entity A there's a failure of saving a completely "unrelated" entity - that sounds reasonable for this error |
# |
Jul 14th 2017, 13:27 |
spriz |
Ah |
# |
Jul 14th 2017, 13:27 |
lorenzo |
if you call save() on another table in a behavipr or after save, then it has the power to roll everything back |
# |
Jul 14th 2017, 13:27 |
spriz |
I see! I'll see if I can find anything weird going on :) |