Matt C.
Well-known member
So in matchmaking add-on, I want to move matches that are older than 1 day to the archived match entity. I want to set up a cron job that runs once a day that searched for each match that is older than 24 hours, and then moves it to the archived match entity.
This is what I have right now:
The part I'm confused about is how to actually move the entity to another entity, if that makes sense. Thank you.
This is what I have right now:
Code:
public function moveOldMatches()
{
/** @var \AH\Matchmaking\Finder\Match $matchFinder */
$matchFinder = $this->finder('AH\Matchmaking:Match');
$matches = $matchFinder
->where('match_date', '>=', time() - 86400)->fetch();
foreach($matches as $match)
{
}
}
The part I'm confused about is how to actually move the entity to another entity, if that makes sense. Thank you.