# |
Oct 3rd 2018, 16:07 |
matsaku |
Ok I got it with a $user != null |
# |
Oct 3rd 2018, 15:58 |
slackebot |
the user exist. If not it throw me an error trying is_empty on null. Sorry for this simple question I feel like I'm not that far ._. |
# |
Oct 3rd 2018, 15:58 |
matsaku |
Hi there, I want to check if the user exist in the database and extract his id in a controller. How do I verify if the user exist and then get his id ? ```PHP $user = $userTable->find() ->select(['id']) ->where(['Users.email =' => $this->request->getData('user')]) ->first(); if (!$user->isEmpty()) { ``` This is the code to get user info. It works only when |
# |
Oct 3rd 2018, 15:56 |
neon1024 |
Yes, seems you’ve done this @narendravaghela :thumbsup: I shall follow your plugins technique |
# |
Oct 3rd 2018, 15:55 |
neon1024 |
Such as creating a custom mail transport |
# |
Oct 3rd 2018, 15:54 |
neon1024 |
Is there a neater way for me to integrate SendGrid, than just calling it’s call instead of Cake\Network\Email |
# |
Oct 3rd 2018, 15:38 |
btx |
@ricksaccous np, fwiw |
# |
Oct 3rd 2018, 15:30 |
neon1024 |
Great thanks, feel free to open ticket for any issues you find :slightly_smiling_face: |
# |
Oct 3rd 2018, 15:29 |
sdevore |
You I have been thinking of using it as I work on adding sparkpost api support…. Since it is early in the process I’ll check out the 2.0/develop branch if you want |
# |
Oct 3rd 2018, 15:04 |
ricksaccous |
@btx thanks for the suggestion |
# |
Oct 3rd 2018, 15:00 |
admad |
nice.. IRC spam get's gobbled up |
# |
Oct 3rd 2018, 15:00 |
btx |
haha sometimes these bot messages seem to fit the conversation |
# |
Oct 3rd 2018, 14:59 |
polly |
either works though |
# |
Oct 3rd 2018, 14:59 |
polly |
who wrote this? |
# |
Oct 3rd 2018, 14:59 |
btx |
yeah basically same ok |
# |
Oct 3rd 2018, 14:57 |
ricksaccous |
i'm not precise about the set up i haven't been here long but it seems to be dev -> review site (QA) -> beta (not sure what this translates to) -> production |
# |
Oct 3rd 2018, 14:56 |
btx |
do you guys have DEV (local) -> Integration -> User Testing -> PROD setup? |
# |
Oct 3rd 2018, 14:56 |
btx |
or do an “INITIAL ENTRY” record and set it to that - either way you’re gonna futz with other dev’s projects (which should only matter when you migrate to your Integration Testing platform) |
# |
Oct 3rd 2018, 14:55 |
slackebot |
anything up with that FK |
# |
Oct 3rd 2018, 14:55 |
btx |
i would definitely avoid truncating tables, that’d be data you’d then have to recreate. and technically if you could recreate it programmatically then you could also have figured out the FK programmatically in the first place. If there are multiple options and it’s not possible to determine the right one AND it’s important to know the right one, then you could do a “MIGRATIONS-20181003” record in the related table and then go back and |
# |
Oct 3rd 2018, 14:55 |
ricksaccous |
might be the best solution at this point, since no client data exists anyway |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
and i'll refactor the migrations |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
related to this |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
so delete all tables |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
for this thing |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
I'm going to squash migrations |
# |
Oct 3rd 2018, 14:54 |
ricksaccous |
honestly i could probably just tell my fellow devs |
# |
Oct 3rd 2018, 14:53 |
ricksaccous |
but it's set automatically via site operated on when creating the record |
# |
Oct 3rd 2018, 14:52 |
ricksaccous |
by other options selected you could guess the user's site |
# |
Oct 3rd 2018, 14:52 |
ricksaccous |
it's linking to the user's site |
# |
Oct 3rd 2018, 14:52 |
btx |
what is it tracking? |
# |
Oct 3rd 2018, 14:52 |
btx |
yeah I should have asked that, what is the column linking to? |
# |
Oct 3rd 2018, 14:51 |
ricksaccous |
in a way the field is actually used to SOMEWHAT track which user created it |
# |
Oct 3rd 2018, 14:51 |
ricksaccous |
it's set for them |
# |
Oct 3rd 2018, 14:51 |
ricksaccous |
but they do when they create it |
# |
Oct 3rd 2018, 14:51 |
ricksaccous |
they don't manually pick |
# |
Oct 3rd 2018, 14:51 |
ricksaccous |
user kind of picks one in a sense |
# |
Oct 3rd 2018, 14:50 |
btx |
and it would be up to the user to pick one? or should it be programmatically determinable? |
# |
Oct 3rd 2018, 14:50 |
ricksaccous |
i could put technically "valid" data |
# |
Oct 3rd 2018, 14:50 |
ricksaccous |
basically i could look at one field, and based on the relationships of that field (in the same table) the fk has a chance of being some value, but the relationships between the tables also means the fk could also have other values |
# |
Oct 3rd 2018, 14:48 |
btx |
how do you know it’s not accurate enough, like what is the inaccuracy? |