# |
Jun 30th 2021, 19:53 |
rightscoreanalysis |
I read that since cake3 it is no longer possible to use the table-less models |
# |
Jun 30th 2021, 19:53 |
rightscoreanalysis |
I am modifying an old Cake2 plugin that integrates with Twitter's API. In the old plugin there is a model file: https://github.com/voycey/cakephp-twitter-api/blob/master/Model/Twitter.php |
# |
Jun 30th 2021, 15:41 |
gutocf |
Hello, I'm trying to create fixtures with the vierge-noire/cakephp-fixture-factories plugin for a belongs to many association with data on the join table, but i didn't find how. Can someone help me with this? |
# |
Jun 30th 2021, 15:12 |
martin |
but in most cases it is not a problem I guess |
# |
Jun 30th 2021, 15:11 |
martin |
or a setting on patchEntity? |
# |
Jun 30th 2021, 14:51 |
dereuromark |
Do we need a patchIfModified() one? |
# |
Jun 30th 2021, 14:40 |
ndm |
Can you maybe supply a small example setup? I'm wondering whether the check in the core might be a bit to strict, or if it's actually a configuration issue. |
# |
Jun 30th 2021, 14:38 |
martin |
ok, I wanted to not send update to endpoint when fields are not changed, but I patch the full array, now I only patch the fields that are changed |
# |
Jun 30th 2021, 14:36 |
ndm |
patching a field will always mark it as dirty, no matter whether the content is identical |
# |
Jun 30th 2021, 14:35 |
ndm |
I probably shouldn't have said "target", given that this is a special term in associations. I really just ment the table class for the association alias. Associations aren't singletons like tables, so different targets should generally be no problem, as that's association config, not table config. |
# |
Jun 30th 2021, 14:35 |
martin |
or does that only happen with the webservice. that is also possible, I see dirty fields but original is empty |
# |
Jun 30th 2021, 14:26 |
martin |
hmm does PatchEntity also makes fields dirty that are not changed, I was thinking it would only make a field dirty when it is really changed |
# |
Jun 30th 2021, 13:25 |
cristianhaunsen |
xd |
# |
Jun 30th 2021, 13:25 |
cristianhaunsen |
also i am running under 8.1alpha 3... usign 4.next branch... |
# |
Jun 30th 2021, 13:24 |
cristianhaunsen |
@chrisshick i am running on 8.0.8 without problem.... |
# |
Jun 30th 2021, 11:43 |
chrisshick |
nvm I had to remove the lock file |
# |
Jun 30th 2021, 11:40 |
chrisshick |
is there something special cakephp needs to be install on 8.0.8? |
# |
Jun 30th 2021, 07:18 |
conehead |
@ndm Just to let you know: using getTarget() unfortunately does not help. In the belongsToMany file, the targets differ. The alias and the className is always the same. The associations of the targets to be precise. Users/Bookmarks are linked with other Entities, that are linked with Users/Bookmarks as well. And these associations differ |
# |
Jun 30th 2021, 05:56 |
conehead |
Good morning everyone |
# |
Jun 29th 2021, 22:44 |
tyler.adam.lazenby |
Its ALIVE!!!! my webhooked, hmac_parsed and verified trigger email WORKS |
# |
Jun 29th 2021, 22:42 |
joey.mukherjee |
Thank you!! The last condition of the OR was where I was getting stuck! |
# |
Jun 29th 2021, 22:35 |
ndm |
```->leftJoinWith('GroundWaterTests') ->where([ 'OR' => [ 'TEST_TYPE' => 'WATR', 'GroundWaterTests.id IS NOT' => null, ] ]) ...``` |
# |
Jun 29th 2021, 22:32 |
ndm |
Same query, yes |
# |
Jun 29th 2021, 22:31 |
joey.mukherjee |
Ok... if I do a LEFT join, can I do the OR in the same query? Or do I want to union two queries? |
# |
Jun 29th 2021, 22:27 |
ndm |
You can't, neither is there syntax for it, nor would it work, as `matching()` uses an `INNER` join, so it's always exclusive. You need to use a `LEFT` join instead, and apply your conditions on the main query. |
# |
Jun 29th 2021, 22:26 |
joey.mukherjee |
I saw that, but couldn't figure out how best to add the "matching" portion. |
# |
Jun 29th 2021, 22:21 |
slackebot |
$query->newExpr()->and([$author, $published]) ]); });``` |
# |
Jun 29th 2021, 22:21 |
khalil |
@joey.mukherjee from the docs: ```$query = $articles->find()->where(function (QueryExpression $exp, Query $query) { // Use add() to add multiple conditions for the same field. $author = $query->newExpr()->or(['author_id' => 3])->add(['author_id' => 2]); $published = $query->newExpr()->and(['published' => true, 'view_count' => 10]); return $exp->or([ 'promoted' => true, |
# |
Jun 29th 2021, 22:18 |
slackebot |
kinda confused with the database schema to make this happen, I'm trying to avoid EAV as much as I can, and I was thinking of using a json column type in MySQL, but since i have never used it before, I'm a bit concerned about performance, especially after what I read online that it has poor performance, and eventually I will need to query the attributes in the json field, so any advise regarding this is welcome! |
# |
Jun 29th 2021, 22:18 |
khalil |
Guys, I have a question, not directly related to CakePHP, but more on db schema level, but I kinda need advise in case someone went through this before. On a CakePHP e-commerce website, I'm working on product variations / attributes, Like, we have Size, Color, Make etc..., and the product can have any combination of these with specific prices, for instance, Size Large Red Leather for $10, Size Medium Red Leather $9 etc... and I'm |
# |
Jun 29th 2021, 22:16 |
joey.mukherjee |
How do I do an OR on a query that has a where or a matching. Something like : ->or (where (['TEST_TYPE' => 'WATR']), matching ('GroundWaterTests')) I want either TEST_TYPE is WATR or there is a related row in another table? |
# |
Jun 29th 2021, 22:13 |
khalil |
Hello! congrats on the 4000+ members :) |
# |
Jun 29th 2021, 22:13 |
kevin.pfeifer |
btw: we hit 4000+ members in the slack support channel :partying_face: |
# |
Jun 29th 2021, 22:11 |
slackebot |
testSend(): void { $this->OrderNotification->send(); }``` |
# |
Jun 29th 2021, 22:11 |
slackebot |
json_decode($this->order, TRUE); $products = $order['line_items']; $line_items = $Woocommerce->getLineItems($products); $commission = $Woocommerce->getCommission($line_items); $this->OrderNotification = new OrderNotificationMailer([ 'state_owner_email' => $state_owner->state_owner_email, 'content' => compact('state_owner', 'commission', 'operator', 'order', 'line_items') ]); } public function |
# |
Jun 29th 2021, 22:11 |
tyler.adam.lazenby |
```public function setUp(): void { parent::setUp(); $state_owner = TableRegistry::getTableLocator()->get('StateOwners')->get(1); $operator = TableRegistry::getTableLocator()->get('Operators')->find()->first(); $this->order = file_get_contents(join(DS, [ROOT, 'tests', 'Resource', 'order.json'])); $registry = new ComponentRegistry(); $Woocommerce = new WoocommerceComponent($registry); $order = |
# |
Jun 29th 2021, 22:11 |
tyler.adam.lazenby |
on the test |
# |
Jun 29th 2021, 22:11 |
tyler.adam.lazenby |
kinda funny how much setup I had to do to make sure the email went through |
# |
Jun 29th 2021, 22:11 |
kevin.pfeifer |
instead of the default Cake\Mailer\Renderer you can set a custom view instance |
# |
Jun 29th 2021, 22:10 |
tyler.adam.lazenby |
almost through this |
# |
Jun 29th 2021, 21:28 |
tyler.adam.lazenby |
what does the viewRender property of the mailer do? |