Get history of changes
public static getOwnerHistory ( |
||
$farm | Farm object | |
리턴 | array |
/** * @param int $farmId * @throws Scalr_Exception_InsufficientPermissions */ public function xGetOwnerHistoryAction($farmId) { $dbFarm = DBFarm::LoadByID($farmId); $this->user->getPermissions()->validate($dbFarm); $this->request->checkPermissions($dbFarm->__getNewFarmObject(), Acl::PERM_FARMS_UPDATE); if ($dbFarm->ownerId == $this->user->getId() || $this->request->hasPermissions($dbFarm->__getNewFarmObject(), Acl::PERM_FARMS_CHANGE_OWNERSHIP)) { $data = array_map(function ($item) { $item['dtTm'] = Scalr_Util_DateTime::convertTz($item['dt']); return $item; }, Entity\FarmSetting::getOwnerHistory(Entity\Farm::findPk($farmId))); $this->response->data(['history' => $data]); } else { throw new Scalr_Exception_InsufficientPermissions(); } }