You are here

public function LogLocation::setLocation in farmOS 2.x

Set a log's location.

Parameters

\Drupal\log\Entity\LogInterface $log: The Log entity.

\Drupal\asset\Entity\AssetInterface[] $assets: An array of location asset entities.

Overrides LogLocationInterface::setLocation

File

modules/core/location/src/LogLocation.php, line 57

Class

LogLocation
Log location logic.

Namespace

Drupal\farm_location

Code

public function setLocation(LogInterface $log, array $assets) : void {
  foreach ($assets as $asset) {
    $log->{static::LOG_FIELD_LOCATION}[] = [
      'target_id' => $asset
        ->id(),
    ];
  }
}