Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Traits/Services/ReturnsUpdatedModels.php
10284 views
1
<?php
2
3
namespace Pterodactyl\Traits\Services;
4
5
trait ReturnsUpdatedModels
6
{
7
private bool $updatedModel = false;
8
9
public function getUpdatedModel(): bool
10
{
11
return $this->updatedModel;
12
}
13
14
/**
15
* If called a fresh model will be returned from the database. This is used
16
* for API calls, but is unnecessary for UI based updates where the page is
17
* being reloaded and a fresh model will be pulled anyways.
18
*/
19
public function returnUpdatedModel(bool $toggle = true): self
20
{
21
$this->updatedModel = $toggle;
22
23
return $this;
24
}
25
}
26
27