# |
Jul 6th 2017, 19:10 |
jeremyharris |
jarard01 what have you tried? usually it accepts any strtotime string |
# |
Jul 6th 2017, 19:10 |
jeremyharris |
@sturm it might be a good exercise in learning, although yes it is quite large and can be daunting. For me, whenever I needed to understand how a feature worked under the hood, I would delve into that specific thing. Eventually, I touched most of the framework |
# |
Jul 6th 2017, 19:10 |
jarard01 |
hi jeremyharris - any ideas how I can use chronos with a datetime field from my db |
# |
Jul 6th 2017, 19:08 |
jeremyharris |
nice obinoob! |
# |
Jul 6th 2017, 19:08 |
obinoob |
slackebot: jeremyharris thank you for your help the 'on' made it happen ;) https://gist.github.com/fccpt/839fc34c156ce0321c04c8045987665d |
# |
Jul 6th 2017, 19:08 |
jarard01 |
sturm, start with the tutorial |
# |
Jul 6th 2017, 19:07 |
sturm |
As a newbie to object-oriented PHP, should I even bother trying to untangle how CakePHP works? It look so complex. Maybe I don’t need to know all of its nuts and bolts? |
# |
Jul 6th 2017, 18:55 |
jarard01 |
if I have a date in the format '1 Jul 2017' how can I create a chronos object |
# |
Jul 6th 2017, 18:54 |
graziel |
ok got it, kind of |
# |
Jul 6th 2017, 18:52 |
graziel |
`country_id` and `status` isnt included in INSERT |
# |
Jul 6th 2017, 18:51 |
graziel |
https://gist.github.com/Graziel/3add00444c31185ac330dc51f7b01059 |
# |
Jul 6th 2017, 18:50 |
admad |
show the debug() of entity b4 it's passed to save() |
# |
Jul 6th 2017, 18:47 |
graziel |
any idea why accessible and dirty field is not being included in INSERT query? |
# |
Jul 6th 2017, 18:39 |
devito |
thanks |
# |
Jul 6th 2017, 18:39 |
devito |
looks liek it did the trick |
# |
Jul 6th 2017, 18:28 |
devito |
thanks |
# |
Jul 6th 2017, 18:28 |
devito |
nice ill give ti a shot |
# |
Jul 6th 2017, 18:26 |
jeremyharris |
then that would probably do it |
# |
Jul 6th 2017, 18:26 |
devito |
yea |
# |
Jul 6th 2017, 18:25 |
jeremyharris |
I’m assuming here you’d let it fail silently |
# |
Jul 6th 2017, 18:25 |
jeremyharris |
the invalid login entity would fail to save if Users didn’t have username |
# |
Jul 6th 2017, 18:23 |
jeremyharris |
you could do a very simple rule that just checks that it exists, e.g. $rules->add(function($entity) { return $this->Users->exists([‘username’ => $entity->username; ]) }, ‘usernameExists’); |
# |
Jul 6th 2017, 18:23 |
devito |
making a invalid login table without calling the users table |
# |
Jul 6th 2017, 18:22 |
devito |
I want to ensure a username exists in users table before i save the new record |
# |
Jul 6th 2017, 18:21 |
jeremyharris |
what are you trying to do :P |
# |
Jul 6th 2017, 18:21 |
jeremyharris |
waiiit nevermind ignore me |
# |
Jul 6th 2017, 18:20 |
jeremyharris |
actually exists in uses arbitrary columns too |
# |
Jul 6th 2017, 18:20 |
devito |
yea |
# |
Jul 6th 2017, 18:20 |
jeremyharris |
sorry |
# |
Jul 6th 2017, 18:20 |
jeremyharris |
oh exists in |
# |
Jul 6th 2017, 18:19 |
jeremyharris |
it operates on a column currently. the example uses “email” |
# |
Jul 6th 2017, 18:19 |
devito |
@jeremyharris do u know if theres a way to use existsin on a column instead of a PK? or Is this something i would need to make myself? |
# |
Jul 6th 2017, 18:14 |
jeremyharris |
obinoob maybe switch to conditional validation instead? https://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation |
# |
Jul 6th 2017, 18:11 |
jarard01 |
wow chronos is powerful! |
# |
Jul 6th 2017, 18:10 |
obinoob |
I just want to run the add method only if notEmpty method fails is this possible? |
# |
Jul 6th 2017, 18:08 |
obinoob |
https://gist.github.com/fccpt/839fc34c156ce0321c04c8045987665d |
# |
Jul 6th 2017, 18:08 |
obinoob |
Hi again, so this code is part of the solution I've found for my earlier question here in channel, I needed to write a validation rule for a text field dependable on checkbox please take a look here |
# |
Jul 6th 2017, 18:07 |
jeremyharris |
:rubberduck: |
# |
Jul 6th 2017, 18:07 |
jarard01 |
grr |
# |
Jul 6th 2017, 18:07 |
jeremyharris |
you need to import it at the top, use Cake\Chronos\Chronos |
# |
Jul 6th 2017, 18:07 |
jarard01 |
use Cake\Chronos\Chronos; |