# |
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? |
# |
Jun 29th 2021, 20:21 |
kevin.pfeifer |
but if you manually create the mailer object anyways you should be fine |
# |
Jun 29th 2021, 20:21 |
kevin.pfeifer |
But I currently don’t know if you can send reusable emails (like https://book.cakephp.org/4/en/core-libraries/email.html#creating-reusable-emails) via the queue mail task. I have already created an issue for that. |
# |
Jun 29th 2021, 20:16 |
tyler.adam.lazenby |
Working on getting my data first and then going to see if I need to update to alpha... because I need to make sure I have some complex calculations done... by the end of the dasy |
# |
Jun 29th 2021, 20:16 |
tyler.adam.lazenby |
@kevin.pfeifer I know I know... especially with abstraction |
# |
Jun 29th 2021, 20:08 |
dereuromark |
Try the New alpha, I soon release then stable |
# |
Jun 29th 2021, 19:58 |
kevin.pfeifer |
sometimes documentation is not that bad :) |
# |
Jun 29th 2021, 19:57 |
tyler.adam.lazenby |
I was poking around in the source code and wasn't seeing that |
# |
Jun 29th 2021, 19:57 |
tyler.adam.lazenby |
COOL |
# |
Jun 29th 2021, 19:57 |
tyler.adam.lazenby |
oh ok |