# |
Jul 30th 2021, 14:46 |
upgrad3d57 |
I just want to delete multiple records based off of a non-primary-key field. |
# |
Jul 30th 2021, 14:45 |
upgrad3d57 |
Anyone give support on why when I use $this->Model->deleteAll(['non_public_key' => $someId); it tells me that it's looking for the Model.id and can't find the field? (There is no ID field on that table) |
# |
Jul 28th 2021, 10:25 |
dereuromark |
@brandon if you want to avoid inline annotation use the props :) Thats why they are typed in annotations, and kept up to date using IdeHelper |
# |
Jul 28th 2021, 10:15 |
paolo.bragagni |
boolan filed is not marked as 'required' |
# |
Jul 28th 2021, 09:47 |
paolo.bragagni |
how to fire a provider rule only when create |
# |
Jul 28th 2021, 07:07 |
paolo.bragagni |
found thanks |
# |
Jul 28th 2021, 07:01 |
paolo.bragagni |
``` $validator->add('title', 'custom', [ 'rule' => 'nosame', 'provider'=>'custom', 'message'=>'custom message' ]); ``` |
# |
Jul 28th 2021, 07:00 |
paolo.bragagni |
how to pass $model? |
# |
Jul 28th 2021, 07:00 |
paolo.bragagni |
for example I'd like to not permit inserting same value so I have to access to model and make a query for $check in $model |
# |
Jul 28th 2021, 06:59 |
paolo.bragagni |
public function nosame($check,$model) : bool |
# |
Jul 28th 2021, 06:58 |
paolo.bragagni |
but How can I pass to it other variables? |
# |
Jul 28th 2021, 06:58 |
paolo.bragagni |
built a Provider and strange but true it works |
# |
Jul 28th 2021, 06:03 |
slackebot2 |
```Access to an undefined property Cake\Datasource\EntityInterface::$type.``` But if I add the following above the code, the error goes away ```/** @var \Inventory\Model\Entity\Attribute $attribute */``` What is the best practice here? Am I missing something? |
# |
Jul 28th 2021, 06:03 |
brandon |
I'm working on cleaning up my code with phpstan. One of the things it complains about a lot of `Access to an undefined property object::$var` for things like `Model->get()` where it can return the Model or an EntityInterface. Am I supposed to use the `@var` doc each time? Here is an example: ```$attribute = $this->AttributeValues->Attributes->get($attribute_id); $datetime = $attribute->type == 'datetime';``` phpstan complains: |
# |
Jul 28th 2021, 04:58 |
brandon |
Where do you put this config? Also, level 6!? Oof. |
# |
Jul 28th 2021, 03:56 |
rohit.onus |
Hi, Anyone using Mpdf library in cakephp 2 ? I'm getting error in load Mpdf library *Class 'Mpdf\Mpdf' not found.* |
# |
Jul 27th 2021, 22:39 |
cnizzardini |
Either hardcode on server or if you're using k8s in configmap or Swarm via env in docker compose. Depends on your infrastructure |
# |
Jul 27th 2021, 22:38 |
cnizzardini |
Yep that would cause it. Don't sent envars via nginx |
# |
Jul 27th 2021, 19:22 |
kevin.pfeifer |
or copy/write the string in a text file and view that file with a hexeditor to see what it actually is |
# |
Jul 27th 2021, 19:10 |
mrgrimpy |
I think I just found the problem. It's when I run bin/cake bake model from CLI (no environment variables). What would be the easiest workaround? |
# |
Jul 27th 2021, 19:01 |
mrgrimpy |
It's in the environment. What's even stranger is when I go in the env() function and I add `if ($val == 'DATABASE_FOO_URL') {` `dd($val):` `}` I get the DSN string. I'm very confused. |
# |
Jul 27th 2021, 18:58 |
kevin.pfeifer |
but yes, the whole encoding bullshit is such a mess |
# |
Jul 27th 2021, 18:58 |
kevin.pfeifer |
you could try https://github.com/neitanod/forceutf8 and see if that helps |
# |
Jul 27th 2021, 18:57 |
kevin.pfeifer |
well as the doc says for mb_detect_encoding() ```Detects the most likely character encoding for string string from an ordered list of candidates.``` |
# |
Jul 27th 2021, 18:54 |
greg138 |
So, this is weird. `mb_check_encoding($filename, 'UTF-8')` returns false. `mb_detect_encoding($filename)` returns "UTF-8"... |