Scalr\Model\Entity\SshKey::loadGlobalByFarmId PHP Method

loadGlobalByFarmId() public method

Find global key by FarmID
public loadGlobalByFarmId ( integer $envId, string $platform, string $cloudLocation, integer $farmId = null ) : SshKey | null
$envId integer
$platform string
$cloudLocation string
$farmId integer optional
return SshKey | null
    public function loadGlobalByFarmId($envId, $platform, $cloudLocation, $farmId = null)
    {
        $farmId = $farmId ? $farmId : NULL;
        $criteria = [['envId' => $envId], ['type' => self::TYPE_GLOBAL], ['platform' => $platform], ['farmId' => $farmId], ['$or' => [['cloudLocation' => ''], ['cloudLocation' => $cloudLocation]]]];
        return self::findOne($criteria);
    }