# |
Jul 3rd 2019, 18:48 |
brian493 |
looks like a model object or collection... not really totally sure what I'm looking at |
# |
Jul 3rd 2019, 18:47 |
cnizzardini |
init, that is |
# |
Jul 3rd 2019, 18:47 |
cnizzardini |
what object is it returning? |
# |
Jul 3rd 2019, 18:47 |
brian493 |
no create() is on the object that init returns |
# |
Jul 3rd 2019, 18:47 |
cnizzardini |
Calling init is returning an array? |
# |
Jul 3rd 2019, 18:47 |
cnizzardini |
Yeah, that is what I am seeing "Loads a class, registers the object in the registry and returns instance of the object. ClassRegistry::init() is used as a factory for models, and handle correct injecting of settings, that assist in testing." |
# |
Jul 3rd 2019, 18:46 |
brian493 |
for some reason create() isn't returning the object I would expect |
# |
Jul 3rd 2019, 18:45 |
brian493 |
docs just say call create() and then save([data in here]) but since I'm getting an array returned from create() that obviously won't work |
# |
Jul 3rd 2019, 18:45 |
cnizzardini |
its been a while since I worked in cake 2 |
# |
Jul 3rd 2019, 18:45 |
cnizzardini |
oh boy |
# |
Jul 3rd 2019, 18:44 |
brian493 |
oh hey :slightly_smiling_face: |
# |
Jul 3rd 2019, 18:42 |
brian__ |
cake 2 |
# |
Jul 3rd 2019, 18:42 |
cnizzardini |
Is this Cake 3.x or 2.x? |
# |
Jul 3rd 2019, 18:42 |
brian__ |
I could use PDO but I figured I'd try and learn the cake way |
# |
Jul 3rd 2019, 18:42 |
brian__ |
insert a row into a table I created |
# |
Jul 3rd 2019, 18:42 |
cnizzardini |
What are you trying to accomplish? |
# |
Jul 3rd 2019, 18:42 |
brian__ |
I'm just copying from code I see in the app so it's possible I'm doing this all wrong. I understand how to query pretty well just never needed to insert rows until now |
# |
Jul 3rd 2019, 18:41 |
cnizzardini |
hmm not familiar with ClassRegistry |
# |
Jul 3rd 2019, 18:41 |
brian__ |
and then this: $storeQuantity = $this->StoreQuantity->create(); |
# |
Jul 3rd 2019, 18:41 |
brian__ |
I'm doing this: $this->StoreQuantity = ClassRegistry::init('StoreQuantity'); |
# |
Jul 3rd 2019, 18:40 |
cnizzardini |
you are calling create on what? what class/object? |
# |
Jul 3rd 2019, 18:40 |
brian__ |
but I can't call save() on an array lol |
# |
Jul 3rd 2019, 18:40 |
brian__ |
so it's seeing my model, obviously, and it's seeing columns I added to the table, so that stuff is working |
# |
Jul 3rd 2019, 18:39 |
brian__ |
the array is ['MyModel']['acolumnfromthetable'] |
# |
Jul 3rd 2019, 18:39 |
brian__ |
got a simple question from a newbie.. I'm working on a app given to me.. I created a table and a model to go with it (my model class is empty right now) and when I call create() it returns an array rather than an object. What step did I miss |
# |
Jul 3rd 2019, 18:38 |
niel45 |
barely |
# |
Jul 3rd 2019, 18:37 |
brian__ |
anyone alive? |
# |
Jul 3rd 2019, 18:36 |
cnizzardini |
h($string, false) seems to work, but is that safe? |
# |
Jul 3rd 2019, 18:34 |
cnizzardini |
Is there a way to allow apostrophes? Ryan O'Rourke is pissed |
# |
Jul 3rd 2019, 18:34 |
cnizzardini |
h() is outputting this: Ryan Oand#39;Rourke |
# |
Jul 3rd 2019, 18:20 |
chrisshick |
is it possible to set the Json format for datetimes within a routed scope? |
# |
Jul 3rd 2019, 17:51 |
liquifiede |
I have a validation on my input `<?= $this->Form->input('lon', ['type' => 'text']) ?>` but when the validation errors, it applies `form-error` to the input field, making it disappear while showing the error message. This is odd, shouldn't it still show the input field to make a correction? |
# |
Jul 3rd 2019, 15:49 |
neothermic |
can't tempt you with a job? :) |
# |
Jul 3rd 2019, 15:48 |
neothermic |
yeah, the shim is my first and most important thing to do after the upgrade steps |
# |
Jul 3rd 2019, 15:48 |
neon1024 |
Yes, I’ve seen job postings |
# |
Jul 3rd 2019, 15:48 |
neothermic |
it scares me slightly, as when we went from 1.3 to 2.x we had 4 developers. Now we have 2 :( |
# |
Jul 3rd 2019, 15:48 |
neon1024 |
Perhaps you can make liberal use of @dereuromark shim and upgrade plugins to help transition |
# |
Jul 3rd 2019, 15:47 |
neon1024 |
Fingers crossed for you and the team @neothermic |
# |
Jul 3rd 2019, 15:19 |
neothermic |
I suspect that once 4.x lands, we'll move to 3.x, but then if 4.x is cheap enough to hit after solving 3.x, then I might be able to migrate us up to 4.x after the 2.x -> 3.x dust settles |
# |
Jul 3rd 2019, 15:18 |
neothermic |
the furthest we've been out of date was on 1.3 when 3.0 got released, but we upgraded to 2.x to keep in support :) |
# |
Jul 3rd 2019, 15:18 |
neothermic |
it'd be more absurd |