Scalr\Api\Service\User\V1beta0\Controller\CostCenters::getCostCenter PHP Метод

getCostCenter() публичный Метод

Gets specified Script taking into account both scope and authentication token
public getCostCenter ( string $ccId ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity
$ccId string Unique identifier of the Cost-Center
Результат Scalr\Stats\CostAnalytics\Entity\CostCentreEntity Returns the Project Entity on success
    public function getCostCenter($ccId)
    {
        /* @var $cc CostCentreEntity */
        $cc = CostCentreEntity::findPk($ccId);
        if (!$cc) {
            throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Requested Cost Center either does not exist or is not owned by your environment.");
        }
        if (!$this->hasPermissions($cc)) {
            //Checks entity level write access permissions
            throw new ApiErrorException(403, ErrorMessage::ERR_PERMISSION_VIOLATION, "Insufficient permissions");
        }
        return $cc;
    }