# |
Sep 17th 2019, 22:04 |
noel |
Hi all. Is this out of date? http://www.bravo-kernel.com/2015/04/how-to-use-a-cakephp-3-rest-api/ I can't get it to work at all. |
# |
Sep 17th 2019, 20:07 |
savant |
No worries, I use caps-lock instead of the shift key for capitalization so that happens to me too @rightscoreanalysis |
# |
Sep 17th 2019, 19:49 |
rightscoreanalysis |
sorry for the caps |
# |
Sep 17th 2019, 19:49 |
rightscoreanalysis |
@savant THANKS i FOUND THAT i WAS MISSING THE NAMESPACE AT THE TOP OF MY MODEL CLASS FILE |
# |
Sep 17th 2019, 19:41 |
savant |
since `ArrayObject` has no namespace, you should use `\ArrayObject` or add a `use` statement at the top of the class in question when using it |
# |
Sep 17th 2019, 19:40 |
savant |
@rightscoreanalysis when referencing a class, if you don’t specify a namespace, it will default to the current namespace |
# |
Sep 17th 2019, 19:35 |
admad |
There's no big, you need to improve your knowledge and understanding of namespaces :slightly_smiling_face: |
# |
Sep 17th 2019, 19:32 |
niel45 |
are you sure? looks like they are two different ArrayObjects. One with a name namespace, one without. |
# |
Sep 17th 2019, 19:24 |
rightscoreanalysis |
it is complaining that an ArrayObject should be passed which it reports is being passed :slightly_smiling_face: |
# |
Sep 17th 2019, 19:24 |
rightscoreanalysis |
Argument 2 passed to App\Model\Table\ClassifiedsTable::beforeMarshal() must be an instance of App\Model\Table\ArrayObject, instance of ArrayObject given |
# |
Sep 17th 2019, 19:24 |
rightscoreanalysis |
this looks like a bug to me: |
# |
Sep 17th 2019, 18:45 |
jotpe |
@birdy247 if this doesn't help, first do a rollback, `$this->table('tablename')->drop()->save();` |
# |
Sep 17th 2019, 17:17 |
ricksaccous |
might need the ->save(); |
# |
Sep 17th 2019, 17:16 |
ricksaccous |
@birdy247 http://docs.phinx.org/en/latest/migrations.html#dropping-a-table |
# |
Sep 17th 2019, 17:16 |
birdy247 |
with only a composite primary key |
# |
Sep 17th 2019, 17:16 |
birdy247 |
its a join table |
# |
Sep 17th 2019, 17:16 |
birdy247 |
yes |
# |
Sep 17th 2019, 17:16 |
ricksaccous |
@birdy247 phinx? |
# |
Sep 17th 2019, 17:15 |
birdy247 |
use $table->drop |
# |
Sep 17th 2019, 17:14 |
birdy247 |
but the table is still there |
# |
Sep 17th 2019, 17:14 |
birdy247 |
It says that it has worked |
# |
Sep 17th 2019, 17:14 |
birdy247 |
I am trying to drop a table |
# |
Sep 17th 2019, 16:57 |
daniel.upshaw |
Thank you @ndm |
# |
Sep 17th 2019, 16:56 |
this.impetus |
@ndm thanks for replying, I started reading about error handling with cake, I underestimated how much there was to read, I should have done that before asking my question; I may be back lol |
# |
Sep 17th 2019, 16:54 |
ndm |
@this.impetus No |
# |
Sep 17th 2019, 16:52 |
ndm |
@daniel.upshaw Middlewares are invoked in the order in which they've been added. The error handler middleware wraps all following middlewares in a `try...catch`, so it's the other way around, stuff that happens before that wouldn't be processed by that handler. There's another error handler though, the one that is by default registered in `config/bootstrap.php`, it will handle errors until the middleware is registered. |
# |
Sep 17th 2019, 16:46 |
this.impetus |
or obviate, maybe is a better word |
# |
Sep 17th 2019, 16:45 |
this.impetus |
... does cake somehow prevent the use of try..catch statements in controllers? |
# |
Sep 17th 2019, 16:43 |
daniel.upshaw |
When it comes to Middleware, what are the implications of the order they are added to the queue? For example, if you add `ErrorHandlerMiddleware` before Authentication, does that mean that errors in the authentication process won't be handled? Or is that what you would want? |
# |
Sep 17th 2019, 16:00 |
neon1024 |
:crossed_fingers: |
# |
Sep 17th 2019, 16:00 |
neon1024 |
..and maybe put the migration in a branch |
# |
Sep 17th 2019, 16:00 |
neon1024 |
Take those database backups first |
# |
Sep 17th 2019, 15:59 |
jotpe |
Thanks :slightly_smiling_face: |
# |
Sep 17th 2019, 15:59 |
jotpe |
I guess I'll write a alter table and convert the entities then. |
# |
Sep 17th 2019, 15:58 |
jotpe |
I live risky by default 8) |
# |
Sep 17th 2019, 15:58 |
neon1024 |
Although kinda dangerous to destroy data in an automated process :face_palm: |
# |
Sep 17th 2019, 15:57 |
neon1024 |
At least then, you could also rollback neatly by converting your date time back to date with ``conference_begin` = DATE(conference_begin)` |
# |
Sep 17th 2019, 15:57 |
neon1024 |
Perhaps you need to write `up()` and `down()` methods with your own `ALTER TABLE..` |
# |
Sep 17th 2019, 15:56 |
neon1024 |
Strange :thinking_face: |
# |
Sep 17th 2019, 15:56 |
jotpe |
yep |
# |
Sep 17th 2019, 15:56 |
neon1024 |
..and the existing column is `DATE` ? |