Implemented Dynamic Items for data to be sent to polled systems based on data in db, like stats/nodelists
This commit is contained in:
@@ -242,6 +242,11 @@ class Address extends Model
|
||||
->with(['zone.domain']);
|
||||
}
|
||||
|
||||
public function dynamics()
|
||||
{
|
||||
return $this->hasMany(Dynamic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Echoareas this address is subscribed to
|
||||
*
|
||||
@@ -691,6 +696,19 @@ class Address extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Files waiting to be sent to this system
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function dynamicWaiting(): Collection
|
||||
{
|
||||
return $this->dynamics()
|
||||
->where('next_at','<=',Carbon::now())
|
||||
->where('active',TRUE)
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Echomail waiting to be sent to this system
|
||||
*
|
||||
|
Reference in New Issue
Block a user