Closed kevinkorb closed 3 years ago
Hey @kevinkorb, thanks for submitting this modification. The delete method is supposed to look like this:
$result = \Telnyx\SomeEndpoint::get($id); $result->delete();
Updates are similar $result = \Telnyx\SomeEndpoint::get($id); $result->update(['field' => 'value']);
I've sent a note to the team about the docs and will be in touch regarding next steps.
Got it, thanks.
From the Telnyx site/docs, it appeared everything was done statically, this makes sense though.
On Dec 11, 2020, 9:31 AM -0600, weroh notifications@github.com, wrote:
Hey @kevinkorb, thanks for submitting this modification. The delete method is supposed to look like this: $result = \Telnyx\SomeEndpoint::get($id); $result->delete(); Updates are similar $result = \Telnyx\SomeEndpoint::get($id); $result->update(['field' => 'value']); I've sent a note to the team about the docs and will be in touch regarding next steps. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@kevinkorb This design was carried over from the Stripe API.
Also, I actually made a mistake. It's supposed to be $result->save($opts). However, \Telnyx\SomeEndpoint::update($id, $opts) is also valid. Currently, delete() is the only method that can't be called statically.
Thanks for your input! Keeping it in mind for near-future updates.
@kevinkorb updated in 45 where delete
remains the same; however remove
has been added to be called statically. I'm publishing update now
I was getting an error saying the Delete could not be called statically, per the documentation on Telnyx's site, it was supposed to be called statically, which matches how you use the rest of the API.