コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
ファイル: Cluster.php プロジェクト: pkdevboxy/dfe-database
 /**
  * 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();
 }