Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Storing single value arrays with Doctrine in MySQL

I return an array of results in which I need to put every value into separate field in my database using Symfony Doctrine.

array:4 [
    "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9."
    "token_type" => "bearer"
    "expires_in" => "2592000"
    "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
] 

So I started like this to pull out my results but I can assign them like separate fields that I need for storing value into 'access_token, 'token_type' field etc..

$newUser = new User();
    $newUser->setAccess($keys['access_token']);
    $newUser->setRefresh($keys['refresh_token']);

Comments