PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
MGE
May 31, 2022 11:32
Hello, when I add a boolean condition in WHERE (boolean field is an index) the query turn slow. How can be it possible? WHERE business_id = '131adasdasdsa' <- return fast. WHERE business_id = '131adasdasdsa' and active = 1 <- return slow. business_id and active are index
MGE
May 30, 2022 10:14
@Tpojka where? this is happening all project classes
MGE
May 30, 2022 09:31
but As you can see, they are different virtual hosts, api-pe y api-co
MGE
May 30, 2022 09:30
PHP Fatal error: Cannot redeclare Safe\\apc_cache_info() (previously declared in /var/www/api-co/releases/20220511125824Z/vendor/thecodingmachine/safe/deprecated/apc.php:27) in /var/www/api-pe/releases/20220511125824Z/vendor/thecodingmachine/safe/deprecated/apc.php on line 27
MGE
May 30, 2022 09:30
Hello, I have this error:
MGE
Mar 23, 2022 11:41
I don't know how to solve this, because this is only showing products that has sale
MGE
Mar 23, 2022 11:41
the problem is that, when I select show not invoiced products, I want to show also the products that pr.sale_id is NULL
MGE
Mar 23, 2022 11:40
filter show invoiced -->> AND sa.invoice_id IS NOT NULL ...... filter dont show invoiced -->> AND sa.invoice_id IS NULL
MGE
Mar 23, 2022 11:40
and then depending on the filter (invoice yes or no)
MGE
Mar 23, 2022 11:40
INNER JOIN products pr ON pr.id = a.id INNER JOIN sales sa ON pr.sale_id = sa.id
MGE
Mar 23, 2022 11:39
Hello, I have a question. I have a query that have an INNER JOIN to detect if the product -> sale has invoice:
MGE
Dec 31, 2020 11:13
is summary: Appointment from 9 to 13. if I search appointments from 9 to 10, it should return the appointment
MGE
Dec 31, 2020 11:10
It will return properly all appointments that are in this time range. The problem occurs when for if appointment fromTime is 9 and toTime is 13, but in the query I use, fom 9 to 10. 10 is not lower than toTime value, in this case 13. How could I use the query in order to get appointments that are in time period? Thank you very much.
MGE
Dec 31, 2020 11:10
Hello, happy new year to all of you. I have a question. I have some appointments that has fromTime and toTime values, when I want to filter to show appointments in a time range, I use a.bookedFrom.datetime >= :fromTime and a.bookedTo.datetime <= :toTime.
MGE
Dec 21, 2020 20:10
btw, thank you for the help, I will try to run without paratest
MGE
Dec 21, 2020 20:09
yes, but seems that there is not a solution yet. Marked as bug. I ask if someone tried any hack.
MGE
Dec 21, 2020 19:44
--stop-on-failure is not working, do you know how to stop running tests once a fail occurs? ./bin/paratest -p half --stop-on-failure --runner=WrapperRunner -c ./phpunit.xml --passthru="'--order-by=random'" tests
MGE
Dec 21, 2020 19:13
Hello, I'm using thowable instead of Exception, getException is deprecated and I need to get the exception class. With exception I was using get_class($exception); How can I access to this info with Throwable object? Thank you
MGE
Sep 25, 2019 16:17
@beberlei hey beberli, thanks any good documentation about this?
MGE
Sep 25, 2019 16:09
and
MGE
Sep 25, 2019 16:09
'value' => $name,
                'constraints' => [
                    new Assert\NotBlank([
                        'message' => $translator->trans('ERRORS_field_empty_validation', ['field' => 'name'], 'messages')
                    ]),
                    new Assert\Type([
                        'type' => 'string',
                        'message' => $translator->trans('ERRORS_field_string_validation', ['field' => 'name'], 'messages')
                    ])
                ]
MGE
Sep 25, 2019 16:09
Hey, I'm using symfony validator and it works pretty good. I can validate fields separately, but could I create a condition? For example, $name and $surname, can be empty, but if these 2 fields are empty, I would like to detect with this validator
MGE
Aug 20, 2019 06:03
I have a question. I have a Value Object for Currency, there is a validator to check if the CODE is allowed, for example: USD, EUR, JPY... but this validator values could be updated via admin panel, to add edit or remove these codes. How could I get these values from ddbb in the V.O? V.O is in DOMAIN layer and I don't know how to add this (infrastructure?) without breaking the DDD pattern.
MGE
Aug 19, 2019 15:34
I have a question. I have a Value Object for Currency, there is a validator to check if the CODE is allowed, for example: USD, EUR, JPY... but this validator values could be updated via admin panel, to add edit or remove these codes. How could I get these values from ddbb in the V.O? V.O is in DOMAIN layer and I don't know how to add this (infrastructure?) without breaking the DDD pattern.
MGE
Aug 14, 2019 11:24
okey thanks, will think about it
MGE
Aug 14, 2019 11:22
" if the address from request is empty then don't use addAddress " this occurs in the use case
MGE
Aug 14, 2019 11:21
so the domain logic will be in the application layer
MGE
Aug 14, 2019 11:20
and in this case Address VO will allow to have an empty address string
MGE
Aug 14, 2019 11:19
so in the client creation use case, I create the client with empty address, but I try $client->addAddress(new Addres('blah'));
MGE
Aug 14, 2019 11:19
but If I create the address independently is cant be empty, how can I achieve it?
MGE
Aug 14, 2019 11:18
@brzuchal the question is when I receive the request for Client creation, the address can be empty or not
MGE
Aug 14, 2019 11:10
I read Martin Fowler, Eric Evans and Carlos Buenosvinos DDD book (xeroxmobileprint.net/DiscoveryTable/test/folder1/…)
MGE
Aug 14, 2019 11:09
but Address is a VO
MGE
Aug 14, 2019 11:09
yes, ClientAddress is an entity
MGE
Aug 14, 2019 10:57
yes
MGE
Aug 14, 2019 10:57
Address is a VO where will ensure that values are valid
MGE
Aug 14, 2019 10:57
what?
MGE
Aug 14, 2019 10:56
yes, its a child entity
MGE
Aug 14, 2019 10:56
it can not be empty
MGE
Aug 14, 2019 10:56
but If you create a new address to that client
MGE
Aug 14, 2019 10:56
and there, address string can be empty so ClientAddress VO should permit empty values
MGE
Aug 14, 2019 10:55
yes
MGE
Aug 14, 2019 10:54
so I need to check in the VO logic, if Address is called from client or not
MGE
Aug 14, 2019 10:54
but in two cases, the VO is the same
MGE
Aug 14, 2019 10:53
but If I try new Address('My address'); without using $client, it can not be empty
MGE
Aug 14, 2019 10:53
when I create the Client object is empty but I try: $client->addAddress($clientAddress); and in this case it can be empty or not
 
MGE
Mar 18, 2022 19:34
I've a question, if I set chmod g-r to a file, but the user has read permissions, which prevails?
MGE
Mar 18, 2022 19:33
hello
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
MGE
Dec 16, 2020 10:24
0
Q: Angular SSR 'Server Side Rendering' Response Time is very slow

MGEI disabled all setTimeOuts() because seems that is a common cause that affect the server time response but the server keep taking more than 2 seconds to response the page to the browser. I would like to know if there is any tool to debug internally in order to detect what is causing this slow re...

MGE
Dec 16, 2020 09:41
Hello, I have a problem using SSR in angular, node takes more than 2 seconds returning the content to the browser. Disabling sSR it takes only 150ms. Any idea about how to solve this problem?