You are here

public function AcquiaDAM_Assets_AbstractAsset::get in Media: Acquia DAM 7

Fetch the asset from the API.

Parameters

bool $refresh: TRUE to force a remote refresh if the asset has already been loaded.

Return value

array|false The request response or FALSE on failure.

8 calls to AcquiaDAM_Assets_AbstractAsset::get()
AcquiaDAM_Assets_AbstractAsset::getDAMPath in src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc
Gets the path to this asset within the DAM web interface.
AcquiaDAM_Assets_AbstractAsset::getPreviewUrl in src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc
Get the URL to the DAM-provided preview if possible.
AcquiaDAM_Assets_AbstractAsset::getThumbnailUrl in src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc
Get the URL to the DAM-provided thumbnail if possible.
AcquiaDAM_Assets_AbstractAsset::offsetExists in src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc
Implementation for ArrayAccess.
AcquiaDAM_Assets_AbstractAsset::offsetGet in src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc
Implementation for ArrayAccess.

... See full list

File

src/AcquiaDAM/AcquiaDAM_Assets_AbstractAsset.inc, line 180

Class

AcquiaDAM_Assets_AbstractAsset
Abstract class base for Acquia DAM assets.

Code

public function get($refresh = FALSE) {
  $this
    ->requireId();
  if ($refresh || empty($this->asset)) {
    $result = $this
      ->request(sprintf('%s/%d', $this
      ->getEndpointBase(), $this->assetId));
    if (!empty($result) && is_array($result)) {
      $this->asset = $result;
    }
  }
  return isset($result) ? $result : $this->asset;
}