Log message #4053549

# At Username Text
# Jul 18th 2017, 15:20 cleptric One second :slightly_smiling_face:
# Jul 18th 2017, 15:20 sonu-nk @cleptric the same i did not find... i was looking at book...
# Jul 18th 2017, 15:20 cleptric sonu-nk bake offers some stuff
# Jul 18th 2017, 15:19 sonu-nk @genellern i am looking for the command or anything which can help me to generate migration files from my database table
# Jul 18th 2017, 15:18 awi When I stop it, it will fail in the controller?
# Jul 18th 2017, 15:18 awi ok...
# Jul 18th 2017, 15:18 cleptric Sorry, i don’t know any elegant way to behonest
# Jul 18th 2017, 15:18 cleptric Uhhh :thinking_face:
# Jul 18th 2017, 15:17 awi can I somehow set a message when i use stoppropagation?
# Jul 18th 2017, 15:16 genellern sonu-nk look at the dump option in the migrations plugin
# Jul 18th 2017, 15:15 cleptric if you call `$event->stopPropagation()` this will stop the delete opration
# Jul 18th 2017, 15:15 cleptric beforeDelete has a `$event` parameter
# Jul 18th 2017, 15:14 awi or something like an return?
# Jul 18th 2017, 15:14 awi What do you mean exactly by "By stopping this event you will abort the delete operation." in https://book.cakephp.org/3.0/en/orm/table-objects.html#beforedelete ? Something like exit;?
# Jul 18th 2017, 15:13 sonu-nk ?
# Jul 18th 2017, 15:13 sonu-nk is there any command in cakephp3 which can generate migration file from database
# Jul 18th 2017, 15:12 neon1024 What about the datasource for the fixture to write to the datastore?
# Jul 18th 2017, 15:12 admad No other setup code
# Jul 18th 2017, 15:12 admad Just include core fixture anf TR::get() to get table instance
# Jul 18th 2017, 15:11 admad It's that easy to test a behaviour https://github.com/UseMuffin/Orderly/blob/master/tests/TestCase/Model/Behavior/OrderlyBehaviorTest.php
# Jul 18th 2017, 15:10 jeremyharris the above is what I do for my behaviors that don’t interact with fixture data
# Jul 18th 2017, 15:09 neon1024 Perhaps I should check the core ORM tests instead of the core behaviour tests
# Jul 18th 2017, 15:09 jeremyharris ``` $this->Table = new Table([ ‘alias’ => ‘Contacts’, ‘connection’ => ConnectionManager::get(‘test’), ]); $this->Table->addBehavior(‘DateConverter’, [ ‘fields’ => [ ‘date’ ] ]); $this->Table->schema()->addColumn(‘date’, [‘type’ => ‘datetime’]);
# Jul 18th 2017, 15:09 jeremyharris you can create a dummy table
# Jul 18th 2017, 15:09 neon1024 Then table takes schema, and urgh
# Jul 18th 2017, 15:09 neon1024 But query takes connection and table
# Jul 18th 2017, 15:09 neon1024 As it’s just testing a beforeFind appends a contain
# Jul 18th 2017, 15:09 neon1024 I hoping to avoid all that
# Jul 18th 2017, 15:08 admad Hell not even a fixture, just use a core one
# Jul 18th 2017, 15:08 admad @neon1024 all you need to create is a fixture and then use TableRegistry::get()
# Jul 18th 2017, 15:02 neon1024 Ah yes, I’ve found the problem I thought wasn’t a thing. It’s trying to test a behaviour. As it needs a table, which needs a connection, and a schema
# Jul 18th 2017, 14:13 admad @saeideng !!!!
# Jul 18th 2017, 14:13 irongomme thxs @mikesmoniker and @saeideng !!
# Jul 18th 2017, 14:12 irongomme Great !
# Jul 18th 2017, 14:12 mikesmoniker You can change them at runtime on the fly.
# Jul 18th 2017, 14:12 saeideng @admad ????
# Jul 18th 2017, 14:12 mikesmoniker @irongomme https://book.cakephp.org/3.0/en/orm/saving-data.html#changing-accessible-fields
# Jul 18th 2017, 14:11 saeideng you can use `$_accessible`
# Jul 18th 2017, 14:11 irongomme @admad :thumbsup:
# Jul 18th 2017, 14:11 admad *sure is
# Jul 18th 2017, 14:11 admad sure it, set it non accessible only in add() method for newEntity() call