You are here

interface AssetLocationInterface in farmOS 2.x

Asset location logic.

Hierarchy

Expanded class hierarchy of AssetLocationInterface

All classes that implement AssetLocationInterface

3 files declare their use of AssetLocationInterface
AssetReorderController.php in modules/core/ui/location/src/Controller/AssetReorderController.php
FarmAssetChildrenViewsAccessCheck.php in modules/core/ui/views/src/Access/FarmAssetChildrenViewsAccessCheck.php
FarmLocationAssetViewsAccessCheck.php in modules/core/ui/views/src/Access/FarmLocationAssetViewsAccessCheck.php

File

modules/core/location/src/AssetLocationInterface.php, line 11

Namespace

Drupal\farm_location
View source
interface AssetLocationInterface {

  /**
   * Check if an asset is a location.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return bool
   *   Returns TRUE if it is a location, FALSE otherwise.
   */
  public function isLocation(AssetInterface $asset) : bool;

  /**
   * Check if an asset is fixed.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return bool
   *   Returns TRUE if it is fixed, FALSE otherwise.
   */
  public function isFixed(AssetInterface $asset) : bool;

  /**
   * Check if an asset is located within other location assets.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return bool
   *   Returns TRUE if the asset has a location, FALSE otherwise.
   */
  public function hasLocation(AssetInterface $asset) : bool;

  /**
   * Check if an asset has geometry.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return bool
   *   Returns TRUE if the asset has geometry, FALSE otherwise.
   */
  public function hasGeometry(AssetInterface $asset) : bool;

  /**
   * Get location assets that an asset is located within.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return array
   *   Returns an array of assets.
   */
  public function getLocation(AssetInterface $asset) : array;

  /**
   * Get an asset's geometry.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return string
   *   Returns a WKT string.
   */
  public function getGeometry(AssetInterface $asset) : string;

  /**
   * Find the latest movement log that references an asset.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   *
   * @return \Drupal\log\Entity\LogInterface|null
   *   A log entity, or NULL if no logs were found.
   */
  public function getMovementLog(AssetInterface $asset) : ?LogInterface;

  /**
   * Set an asset's intrinsic geometry.
   *
   * @param \Drupal\asset\Entity\AssetInterface $asset
   *   The Asset entity.
   * @param string $wkt
   *   Geometry as a WKT string.
   */
  public function setIntrinsicGeometry(AssetInterface $asset, string $wkt) : void;

  /**
   * Get assets that are in locations.
   *
   * @param \Drupal\asset\Entity\AssetInterface[] $locations
   *   An array of location assets to lookup.
   *
   * @return \Drupal\asset\Entity\AssetInterface[]
   *   Returns an array of assets.
   */
  public function getAssetsByLocation(array $locations) : array;

}

Members

Namesort descending Modifiers Type Description Overrides
AssetLocationInterface::getAssetsByLocation public function Get assets that are in locations.
AssetLocationInterface::getGeometry public function Get an asset's geometry.
AssetLocationInterface::getLocation public function Get location assets that an asset is located within.
AssetLocationInterface::getMovementLog public function Find the latest movement log that references an asset.
AssetLocationInterface::hasGeometry public function Check if an asset has geometry.
AssetLocationInterface::hasLocation public function Check if an asset is located within other location assets.
AssetLocationInterface::isFixed public function Check if an asset is fixed.
AssetLocationInterface::isLocation public function Check if an asset is a location.
AssetLocationInterface::setIntrinsicGeometry public function Set an asset's intrinsic geometry.