You are here

interface LogLocationInterface in farmOS 2.x

The interface for log location logic.

Hierarchy

Expanded class hierarchy of LogLocationInterface

All classes that implement LogLocationInterface

File

modules/core/location/src/LogLocationInterface.php, line 10

Namespace

Drupal\farm_location
View source
interface LogLocationInterface {

  /**
   * Check if a log references location assets.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   *
   * @return bool
   *   Returns TRUE if the log references location assets, FALSE otherwise.
   */
  public function hasLocation(LogInterface $log) : bool;

  /**
   * Check if a log has geometry.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   *
   * @return bool
   *   Returns TRUE if the log has geometry, FALSE otherwise.
   */
  public function hasGeometry(LogInterface $log) : bool;

  /**
   * Get location assets referenced by a log.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   *
   * @return array
   *   Returns an array of assets.
   */
  public function getLocation(LogInterface $log) : array;

  /**
   * Get a log's geometry.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   *
   * @return string
   *   Returns a WKT string.
   */
  public function getGeometry(LogInterface $log) : string;

  /**
   * Set a log's location.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   * @param \Drupal\asset\Entity\AssetInterface[] $assets
   *   An array of location asset entities.
   */
  public function setLocation(LogInterface $log, array $assets) : void;

  /**
   * Set a log's geometry.
   *
   * @param \Drupal\log\Entity\LogInterface $log
   *   The Log entity.
   * @param string $wkt
   *   The geometry as a WKT string.
   */
  public function setGeometry(LogInterface $log, string $wkt) : void;

}

Members

Namesort descending Modifiers Type Description Overrides
LogLocationInterface::getGeometry public function Get a log's geometry. 1
LogLocationInterface::getLocation public function Get location assets referenced by a log. 1
LogLocationInterface::hasGeometry public function Check if a log has geometry. 1
LogLocationInterface::hasLocation public function Check if a log references location assets. 1
LogLocationInterface::setGeometry public function Set a log's geometry. 1
LogLocationInterface::setLocation public function Set a log's location. 1