/**
  * Returns an collection of clusters to which $serverId is assigned
  *
  * @param string|int $serverId
  *
  * @return array|\Illuminate\Database\Eloquent\Collection|static[]
  */
 protected static function findServerClusters($serverId)
 {
     return ClusterServer::with(['server', 'cluster'])->where('server_id', '=', $serverId)->get();
 }
Esempio n. 2
0
 /**
  * Returns a list of servers assigned to me
  *
  * @return \DreamFactory\Enterprise\Database\Models\ClusterServer[]|\Illuminate\Database\Eloquent\Collection
  */
 public function assignedServers()
 {
     return ClusterServer::with('server')->where('cluster_id', $this->id)->get();
 }