public function __construct(Connection
$connection) { $this->connection =
$connection;
} /**
* @throws InvalidArgumentException
*/
public function synchronize(Plugin
$plugin, array
$cronjobs) { foreach ($cronjobs as $cronjob) { $this->
addCronjob($plugin,
$cronjob);
} $this->
removeNotExistingEntries($plugin->
getId(),
array_column($cronjobs, 'action'
));
} /**
* @param array $cronjob
*/
private function addCronjob(Plugin
$plugin,
$cronjob) { $cronjob['pluginID'
] =
$plugin->
getId();