Log message #4185128

# At Username Text
# May 1st 2019, 07:13 megan Yupp - the team was working on the book last night, so prob related and hopefully up soon!
# May 1st 2019, 07:12 roel It's only the 3.0 cook book, I guess?
# May 1st 2019, 07:11 megan kiwi_81 - checking it out!
# May 1st 2019, 06:58 kiwi_81 *down
# May 1st 2019, 06:58 kiwi_81 It seems the whole Cake cookbook doc is done with a 404?
# May 1st 2019, 06:54 mrfeedback @ra7bi you should define a global javascript var in your view and then check and access it in your javascript
# May 1st 2019, 06:32 hippo are the docs working
# May 1st 2019, 04:13 admad @ra7bi so you are asking whether you can use PHP code in a static JS file?
# May 1st 2019, 03:48 ra7bi is it possible to use `<?= $this->request->webroot; ?>` in `webroot/js/file.js`
# May 1st 2019, 00:45 voycey https://book.cakephp.org/3.0/en/orm/associations.html ``` class CategoriesTable extends Table { public function initialize(array $config) { $this->hasMany('SubCategories', [ 'className' => 'Categories' ]); $this->belongsTo('ParentCategories', [ 'className' => 'Categories' ]); } }```
# May 1st 2019, 00:41 voycey @noel I think you would just need to create an association back to the same table class with the field that you plan to self join on
# May 1st 2019, 00:40 voycey Was hoping there was some magic to do that - oh well!
# Apr 30th 2019, 23:27 noel Specifically I want to know how to create a schema for a self many to many relationship (i.e. same table with many-to-many to self) so that Bake picks up the schema correctly. I’ve already figured it out for the other types (although some documentation on that would have been helpful.)
# Apr 30th 2019, 23:25 noel Evening. Where can I find examples of schemas for the various relationship types of the ORM?
# Apr 30th 2019, 20:52 rmamba figured it out. CakePHP doesn't like if indexes have same name as columns
# Apr 30th 2019, 19:20 willem No. Normal tables.
# Apr 30th 2019, 19:17 admad @willem it means your table class isnt being used in association hence ORM doesnt have it's schema info. Are those plugin tables?
# Apr 30th 2019, 18:49 willem how could this happen. i have a tinyint (1) field as aboolean in the table. if i directly use the table and set the where to ' => false, the resulting sql is correctly cast to a 0. if i use this table in a joined query using contian and put the same in the where clause, it is cast incorrectly as a ‘ ' (string) ```
# Apr 30th 2019, 18:37 jeremyharris daniel95 yep, people are usually in here to help out. post your question and if someone’s here that can help, they’ll answer! :slightly_smiling_face:
# Apr 30th 2019, 18:25 daniel95 Hello, is it possible to get some support here or not? BR daniel
# Apr 30th 2019, 17:50 rmamba but not with cakephp code
# Apr 30th 2019, 17:50 hollistergraham123 I can access other methods in the same controller that existed yesterday but anything I add I just get that error
# Apr 30th 2019, 17:50 rmamba I looked at logs and if I run sql in the db I get daba back
# Apr 30th 2019, 17:50 rmamba been away from CakePHP since 1.x and now putting 3.7.x app together but I can't get any data from my database
# Apr 30th 2019, 17:49 hollistergraham123 This is the function
# Apr 30th 2019, 17:48 hollistergraham123 This is the error message ` "Action InventorysController::test() could not be found, or is not accessible."`
# Apr 30th 2019, 17:48 hollistergraham123 All of a sudden my cakephp just stopped recognizing new controller methods. Any ideas.
# Apr 30th 2019, 17:40 slackebot property but it doesn't seem to. Ideas? Basically I'm using `$this->$model->associations()->keys()` to build menus for content management and wish to programatically include, say, `User` and `Posts` associations but exclude associations with models like `ImagesArticles`
# Apr 30th 2019, 17:40 this.impetus Searching here: https://api.cakephp.org/3.7/class-Cake.ORM.Association.html Trying to determine from an Association Object whether it the associated model has a HABTM relationship with the current model context. A call to `debug()` on an association object reveals a protected property, `_targetTable` that seems to do for making this inference (only HABTM associations seem to populate it); I'd hoped `getTarget()` would access this
# Apr 30th 2019, 16:11 this.impetus :,)
# Apr 30th 2019, 16:10 ricksaccous if it weren't for you meddling kids
# Apr 30th 2019, 16:10 ricksaccous i would have gotten away with it too
# Apr 30th 2019, 16:10 this.impetus And only a team of unlikely misfits can save me
# Apr 30th 2019, 16:10 this.impetus Hubris will be my downfall, in the end.
# Apr 30th 2019, 16:10 this.impetus I've seen this episode.
# Apr 30th 2019, 16:09 ricksaccous as you keep growing you will achieve super saiyan status
# Apr 30th 2019, 16:09 ricksaccous and then you grow brain cells and your power increases
# Apr 30th 2019, 16:09 this.impetus It's silly, I know, but years ago when I learned cake the first time, this was how I did it; do every irritating little thing as cakey as possible, and the logic absorbs
# Apr 30th 2019, 16:08 ricksaccous lol
# Apr 30th 2019, 16:08 ricksaccous just create a new helper class and use the trait in it
# Apr 30th 2019, 16:08 this.impetus Ah! yep. got it. ty and @admad vm