# |
Jul 6th 2018, 09:35 |
braeden |
:O |
# |
Jul 6th 2018, 09:35 |
neon1024 |
That does remind me though, I need to email the NSA their account details |
# |
Jul 6th 2018, 09:34 |
braeden |
haha, I know, just playing |
# |
Jul 6th 2018, 09:34 |
neon1024 |
@braeden If you use `varchar(255)` Cake will bake the rule out for you :slightly_smiling_face: |
# |
Jul 6th 2018, 09:34 |
james.phillips |
@bravo-kernel will do sorry if I misled you I didnt notice that bit was wrong... The response look correct so I was happy |
# |
Jul 6th 2018, 09:34 |
braeden |
^__^ |
# |
Jul 6th 2018, 09:34 |
braeden |
255 length password, is this app for the NSA? |
# |
Jul 6th 2018, 09:33 |
bravo-kernel |
@james.phillips :ballot_box_with_check: let us know if you manage to get the response example looking like JSON API |
# |
Jul 6th 2018, 09:32 |
neon1024 |
File uploaded https://cakesf.slack.com/files/U1BT622HW/FBKNTTA68/validation_field_passing_repetition.php / https://slack-files.com/T053DPNCM-FBKNTTA68-afcc380209 |
# |
Jul 6th 2018, 09:31 |
neon1024 |
Validation having to pass the field into every rule feels like a bad api |
# |
Jul 6th 2018, 09:29 |
james.phillips |
@bravo-kernel if the the model and example "model" value matched just the "data" section part i happy, thou im missing the attributes section in mine so I will look at annotaions later if I get time today |
# |
Jul 6th 2018, 09:26 |
lorenzo |
right |
# |
Jul 6th 2018, 09:26 |
k4t |
->filter(...)->first() |
# |
Jul 6th 2018, 09:26 |
k4t |
nice |
# |
Jul 6th 2018, 09:26 |
lorenzo |
if you do `->first()` |
# |
Jul 6th 2018, 09:26 |
lorenzo |
no, it will only filter until the first one returns true @k4t |
# |
Jul 6th 2018, 09:26 |
james.phillips |
@bravo-kernel sorry I now understand, yes might is working like yours... I didn't notice that Example Value was just missing the json api... the response was correct and I was happy with that ;) |
# |
Jul 6th 2018, 09:25 |
k4t |
but when I call ->filter on it then every elements in that collection needs to be compared so they are demanded, right? |
# |
Jul 6th 2018, 09:24 |
lorenzo |
@k4t ok, then that is a lazy collection. No need to stop the loop, elements are only processed on demand |
# |
Jul 6th 2018, 09:24 |
josbeir |
:) |
# |
Jul 6th 2018, 09:24 |
josbeir |
it has like 10000000 traits |
# |
Jul 6th 2018, 09:24 |
neon1024 |
Can we just use an emoji typehint in the code! :) |
# |
Jul 6th 2018, 09:24 |
josbeir |
but i must agree, the whole time stuff has so much nested stuff its not easy to get a good understanding of it |
# |
Jul 6th 2018, 09:23 |
neon1024 |
Touché! |
# |
Jul 6th 2018, 09:23 |
lorenzo |
it can be string, int, datetimeinterface |
# |
Jul 6th 2018, 09:23 |
josbeir |
:P |
# |
Jul 6th 2018, 09:23 |
josbeir |
as you once said @neon1024: RTFM |
# |
Jul 6th 2018, 09:23 |
lorenzo |
@neon1024 that’s actaully what the type is :shrug: |
# |
Jul 6th 2018, 09:22 |
k4t |
@lorenz I am iterating over results set from database |
# |
Jul 6th 2018, 09:22 |
josbeir |
https://book.cakephp.org/3.0/en/core-libraries/time.html#creating-time-instances |
# |
Jul 6th 2018, 09:22 |
neon1024 |
So it seems it’s data type is :shrug: |
# |
Jul 6th 2018, 09:22 |
neon1024 |
https://github.com/cakephp/cakephp/blob/master/src/I18n/Time.php#L105-L108 |
# |
Jul 6th 2018, 09:22 |
braeden |
:,( |
# |
Jul 6th 2018, 09:22 |
josbeir |
:) yep |
# |
Jul 6th 2018, 09:22 |
braeden |
4.0? |
# |
Jul 6th 2018, 09:22 |
neon1024 |
Man I’m looking forward to Cake adopting scalar type hints |
# |
Jul 6th 2018, 09:21 |
josbeir |
new Time('-1 hour') should work |
# |
Jul 6th 2018, 09:21 |
josbeir |
strtotime is not needed i think |
# |
Jul 6th 2018, 09:21 |
neon1024 |
Seems like it makes sense to me at least :slightly_smiling_face: Thanks @josbeir |
# |
Jul 6th 2018, 09:20 |
neon1024 |
File uploaded https://cakesf.slack.com/files/U1BT622HW/FBL4E7XQD/check_for_resetting_a_password.php / https://slack-files.com/T053DPNCM-FBL4E7XQD-05df9508df |
# |
Jul 6th 2018, 09:19 |
lorenzo |
what are you iterating? is it just an array? |