misc_pterodactyl-panel/app/Traits/Services/ReturnsUpdatedModels.php
Dane Everitt 15289b76a7
Finish first round of User/Node API additions
Will still need some tweaking and improvements to allow everything to be used.
2018-01-01 15:11:44 -06:00

35 lines
706 B
PHP

<?php
namespace Pterodactyl\Traits\Services;
trait ReturnsUpdatedModels
{
/**
* @var bool
*/
private $updatedModel = false;
/**
* @return bool
*/
public function getUpdatedModel()
{
return $this->updatedModel;
}
/**
* If called a fresh model will be returned from the database. This is used
* for API calls, but is unnecessary for UI based updates where the page is
* being reloaded and a fresh model will be pulled anyways.
*
* @param bool $toggle
*
* @return $this
*/
public function returnUpdatedModel(bool $toggle = true)
{
$this->updatedModel = $toggle;
return $this;
}
}