# |
Feb 11th 2018, 08:36 |
saeideng |
The each() method will not create a new collection, but will allow you to modify any objects within the collection: |
# |
Feb 11th 2018, 08:31 |
K4T |
admad could you explain why each is not working? According to doc: "but will allow you to modify any objects within the collection:" |
# |
Feb 11th 2018, 08:24 |
admad |
K4T: use map() instead of each() |
# |
Feb 11th 2018, 08:14 |
K4T |
any ideas, please? |
# |
Feb 11th 2018, 08:14 |
K4T |
Hello, in CakePHP 3.5 I have collection made from array. I am trying to use ->each method to unset some fields from each collection item. Unfortunatelly it looks like each is not modifing collection itself like it is mentioned in documentation. Here is the code: https://gist.github.com/K4T/8c0d271c9f6ee0bc030c90a6418a4d43 |
# |
Feb 11th 2018, 07:45 |
ricksaccous |
not sure that will 100% work because you still might get the table not found error with that |
# |
Feb 11th 2018, 07:44 |
ricksaccous |
then try to do echo $this->Modelname->hamburger; |
# |
Feb 11th 2018, 07:43 |
ricksaccous |
{ public $hamburger = "Loaded"; } |
# |
Feb 11th 2018, 07:43 |
ricksaccous |
i guess create a property in the class like |
# |
Feb 11th 2018, 07:37 |
sujay |
is there any ways to test if its properly loaded? |
# |
Feb 11th 2018, 07:37 |
sujay |
the model is loaded |
# |
Feb 11th 2018, 07:37 |
sujay |
its 2.x, and i'm using the same copy as on the servers |
# |
Feb 11th 2018, 07:34 |
ricksaccous |
are you completely sure you are using same version of cake on test and production server? |
# |
Feb 11th 2018, 07:33 |
ricksaccous |
are you sure the model is loading? |
# |
Feb 11th 2018, 07:33 |
ricksaccous |
are you using cakephp3? |
# |
Feb 11th 2018, 07:33 |
sujay |
would it be related to any naming or somethings? |
# |
Feb 11th 2018, 07:32 |
sujay |
same issue |
# |
Feb 11th 2018, 07:32 |
sujay |
tried changing name of the table |
# |
Feb 11th 2018, 07:32 |
sujay |
i checked the models also |
# |
Feb 11th 2018, 07:31 |
ricksaccous |
oh... |
# |
Feb 11th 2018, 07:31 |
sujay |
mysql |
# |
Feb 11th 2018, 07:30 |
ricksaccous |
what db engine are you using? |
# |
Feb 11th 2018, 07:30 |
ricksaccous |
sounds like a server issue then |
# |
Feb 11th 2018, 07:30 |
sujay |
:sleepy: |
# |
Feb 11th 2018, 07:30 |
sujay |
test server it works fine |
# |
Feb 11th 2018, 07:30 |
ricksaccous |
probably, lol |
# |
Feb 11th 2018, 07:29 |
ricksaccous |
can a db table even have a period in the name? |
# |
Feb 11th 2018, 07:29 |
sujay |
the issue only seems to have in production server |
# |
Feb 11th 2018, 07:29 |
sujay |
the table exists |
# |
Feb 11th 2018, 07:29 |
sujay |
ive checked in db |
# |
Feb 11th 2018, 07:29 |
ricksaccous |
the table doesn't exist? |
# |
Feb 11th 2018, 07:28 |
sujay |
any idea why it throws following error ? 2018-02-11 12:30:06 Error: [PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owbrovnb_owbro.Wsearchana' doesn't exist |
# |
Feb 11th 2018, 06:38 |
ricksaccous |
the encrypted passwords should be the same |
# |
Feb 11th 2018, 06:37 |
ricksaccous |
you encrypt the password the user types in the same way then compare them |
# |
Feb 11th 2018, 06:37 |
ricksaccous |
yes |
# |
Feb 11th 2018, 05:59 |
kevin |
Im saving the league password in the DB using the setPassword() function in the LeaguesTable, so its being encrypted. |
# |
Feb 11th 2018, 05:59 |
kevin |
is there a way to manually create a form in CakePHP 3 and have the password compare to a password in the DB thats been encrypted? Basically, in order to join a League, you need to know the password. |
# |
Feb 11th 2018, 04:59 |
ricksaccous |
yep |
# |
Feb 11th 2018, 04:57 |
humbba12 |
oh thanks for sharing the code snippet :) |
# |
Feb 11th 2018, 04:56 |
ricksaccous |
no problem ;) |
# |
Feb 11th 2018, 04:56 |
ricksaccous |
not perfect |