class UsageTracker implements TrackerInterface (View source)

Properties

private EntityManager $manager
private FileUsageRepository $repository

Methods

__construct(EntityManagerInterface $manager)

No description

track(TrackableInterface $trackable)

Track a trackable object Any object could be passed to this method so long as it implements TrackableInterface

forget(TrackableInterface $trackable)

Forget a trackable object Any object could be passed to this method so long as it implements TrackableInterface

trackCollection(Collection $collection)

Track a collection object

forgetCollection(Collection $collection)

Forget about a collection object

trackFileTrackable(FileTrackableInterface $trackable)

No description

trackAttributes(Collection $collection, array $attributes)

No description

trackBlocks(Collection $collection, array $blocks)

Track a list of blocks for a collection

getTrackables(array $list, callable $transformer = null)

No description

trackTrackables(Collection $collection, Iterator|FileTrackableInterface[] $trackables, callable $persist)

No description

bool
persist($file_id, $collection_id, $collection_version_id, $block_id)

No description

Details

__construct(EntityManagerInterface $manager)

Parameters

EntityManagerInterface $manager

TrackerInterface|TrackerInterface track(TrackableInterface $trackable)

Track a trackable object Any object could be passed to this method so long as it implements TrackableInterface

Parameters

TrackableInterface $trackable

Return Value

TrackerInterface|TrackerInterface

TrackerInterface|TrackerInterface forget(TrackableInterface $trackable)

Forget a trackable object Any object could be passed to this method so long as it implements TrackableInterface

Parameters

TrackableInterface $trackable

Return Value

TrackerInterface|TrackerInterface

private trackCollection(Collection $collection)

Track a collection object

Parameters

Collection $collection

private forgetCollection(Collection $collection)

Forget about a collection object

Parameters

Collection $collection

private trackFileTrackable(FileTrackableInterface $trackable)

Parameters

FileTrackableInterface $trackable

private trackAttributes(Collection $collection, array $attributes)

Parameters

Collection $collection
array $attributes

private trackBlocks(Collection $collection, array $blocks)

Track a list of blocks for a collection

Parameters

Collection $collection
array $blocks

private Generator getTrackables(array $list, callable $transformer = null)

Parameters

array $list
callable $transformer

Return Value

Generator

private trackTrackables(Collection $collection, Iterator|FileTrackableInterface[] $trackables, callable $persist)

Parameters

Collection $collection
Iterator|FileTrackableInterface[] $trackables
callable $persist A callable that manages persisting the trackable

private bool persist($file_id, $collection_id, $collection_version_id, $block_id)

Parameters

$file_id
$collection_id
$collection_version_id
$block_id

Return Value

bool