PWaddict Posted April 19, 2021 Share Posted April 19, 2021 Hi! Is this the proper way to save only 2 fields on a page via API? $order->of(false); $order->pad_user = $u->id; // Save only the pad_user field $order->save("pad_user"); $expireDate = date("Y-m-d", strtotime("+1 year", $order->pad_paid)); $order->expire_date = $expireDate; // Save only the expire_date field $order->save("expire_date"); Link to comment Share on other sites More sharing options...
Pixrael Posted April 19, 2021 Share Posted April 19, 2021 https://processwire.com/api/ref/page/set-and-save/ // Not needed: $order->of(false); $order->setAndSave([ 'pad_user' => $u->id, 'expire_date' => $expireDate, ]); 8 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now