# |
Apr 4th 2019, 18:07 |
this.impetus |
*I've changed this in the table, the Model/Table, and Fixtures. Everywhere I can find that labels this column |
# |
Apr 4th 2019, 18:06 |
this.impetus |
Maybe y'all getting tired of my nub questions, wouldn't fault you, but have another one. In the baked index view for one of my models, I'd originally misidentified a column as "int" when it ought to have been "string". I |
# |
Apr 4th 2019, 18:00 |
dereuromark |
many use cases would benefit from it. |
# |
Apr 4th 2019, 17:58 |
dereuromark |
never seen it. maybe you can port sth like https://github.com/juampi92/cursor-pagination into cake pagination as opt in Plugin-extension/replacement |
# |
Apr 4th 2019, 17:32 |
np |
@neon1024 > Did anyone ever develop a cursor paginator for Cake? We use this approach in our shells when push data into solr. |
# |
Apr 4th 2019, 17:08 |
this.impetus |
as an additional bit of info... my error is thrown at this line ```$supervisedTheses = $this->paginate($this->SupervisedTheses);```; adding ```debug($this->SupervisedTheses);``` immediately before this line just prints ```false``` |
# |
Apr 4th 2019, 17:00 |
feLiruc |
guys, I'm strugguling trying to save a relationship 1 to many... the X table is with hasMany, and the Y table is with belongTo... but when I'm patching the X entity the Y is not saving... |
# |
Apr 4th 2019, 16:57 |
this.impetus |
I've tried adding this to my bootstrap file, ```Inflector::rules('irregular', ['theses' => 'thesis']);``` as per the CookBook but this has no effect; the index method, for example, fires "Unable to locate an object compatible with paginate." |
# |
Apr 4th 2019, 16:52 |
this.impetus |
Ok, here's an odd one: I have a table called "supervised_theses", which seems to utterly confound cake's inflection and so my baked views don't work. I could just change the table to 'subthes' or something, but then there's no chance of leveraging the inflector whenever I want the table name humanized. What's the best way to work around this linguistic hiccup? |
# |
Apr 4th 2019, 16:18 |
saini.vikas630 |
How can I find the articles that are common in given category Ids in cakephp3 |
# |
Apr 4th 2019, 15:23 |
rochasmarcelo |
@weto.jc at "'host' => env('MYSQL_URL', false)," you can't call a function when defining a property, you will need to create a __construct method and set the $default property |
# |
Apr 4th 2019, 15:05 |
xavier83ar |
it works like a charm |
# |
Apr 4th 2019, 15:01 |
dereuromark |
may the matrix be with u |
# |
Apr 4th 2019, 15:01 |
xavier83ar |
thanks guys! :+1::skin-tone-4: |
# |
Apr 4th 2019, 15:01 |
berarma |
Source: I've fought the system a lot. :) |
# |
Apr 4th 2019, 15:01 |
dereuromark |
:slightly_smiling_face: ok |
# |
Apr 4th 2019, 15:01 |
admad |
rage against the machine :P |
# |
Apr 4th 2019, 15:00 |
berarma |
@dereuromark It takes some experience to know when you're fighting the system or simply ignorant of some feature. :slightly_smiling_face: |
# |
Apr 4th 2019, 15:00 |
xavier83ar |
I knew that there must be a way, thanks! |
# |
Apr 4th 2019, 14:59 |
admad |
https://book.cakephp.org/3.0/en/orm/query-builder.html#inserting-data |
# |
Apr 4th 2019, 14:59 |
dereuromark |
why do people always fight the system :P dont get it |
# |
Apr 4th 2019, 14:59 |
xavier83ar |
that's the way to go I guess |
# |
Apr 4th 2019, 14:59 |
xavier83ar |
ahhh |
# |
Apr 4th 2019, 14:59 |
admad |
also you can directly use the db layer to do insert instead of ORM methods |
# |
Apr 4th 2019, 14:58 |
xavier83ar |
every source remove all records from that source, ->deleteAll(['source' => 'this-source']) ...then reinsert records from that source |
# |
Apr 4th 2019, 14:57 |
xavier83ar |
so I can't truncate it |
# |
Apr 4th 2019, 14:57 |
xavier83ar |
the thing is that there are more that one external source that feed the table |
# |
Apr 4th 2019, 14:56 |
admad |
and truncate the table to reset autoincrement :slightly_smiling_face: |
# |
Apr 4th 2019, 14:54 |
gapiangco |
a primary key using UNSIGNED BIGINT data type won't worry you to reach it limits :slightly_smiling_face: |
# |
Apr 4th 2019, 14:54 |
xavier83ar |
cakephp 3.7.4 |
# |
Apr 4th 2019, 14:54 |
xavier83ar |
line 2080 |
# |
Apr 4th 2019, 14:54 |
xavier83ar |
src\Cake\ORM\Table::_insert() |
# |
Apr 4th 2019, 14:53 |
xavier83ar |
bake command generate the table object with the standard 'id' key, I've removed, but I got this error anyway 'Cannot insert row in "%s" table, it has no primary key.', |
# |
Apr 4th 2019, 14:51 |
xavier83ar |
so I've tried to do so, remove the id and rebake model layer.. no problem so far |
# |
Apr 4th 2019, 14:50 |
xavier83ar |
I may use other type of primary key... but I do realize that I don't need one |
# |
Apr 4th 2019, 14:49 |
xavier83ar |
but if I use an autoincremente id, every time the table is updated, the id would keep increasing, reaching limits soons |
# |
Apr 4th 2019, 14:48 |
xavier83ar |
no need for deleted or edit single record |
# |
Apr 4th 2019, 14:48 |
xavier83ar |
it's a table that's like a temporal table, a cache of many others sources, everytime it gets updated by a source it removes all records from that source and insert new ones |
# |
Apr 4th 2019, 14:47 |
dereuromark |
pretty sure it does, why would you ever want that though |
# |
Apr 4th 2019, 14:46 |
xavier83ar |
Hi guys, does the cakephp 3 ORM support insert records to a table without a primary key? |
# |
Apr 4th 2019, 14:46 |
this.impetus |
nvm, guess-solved that one |