-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use count to use check return by ->get() #101
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,12 +377,12 @@ private function addVMCustomFields($SUBID) | |
->where('type', 'product') | ||
->where('relid', $this->params['packageid']) | ||
->where('fieldname', 'LIKE', 'subid|%')->get(); | ||
if ($customField) | ||
if (count($customField) > 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed and actually breaks the logic flow in things when was debugging this thoroughly today |
||
{ | ||
$customFieldValue = Capsule::table('tblcustomfieldsvalues') | ||
->where('fieldid', $customField[0]->id) | ||
->where('relid', $this->serviceID)->get(); | ||
if ($customFieldValue) | ||
if (count($customFieldValue) > 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing here. |
||
{ | ||
$customFieldValue = Capsule::table('tblcustomfieldsvalues') | ||
->where('fieldid', $customField[0]->id) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -490,7 +490,7 @@ public static function getAvailableIsos($isosList) | |
public static function getUserScripts($clientID, $scripts) | ||
{ | ||
$allowScripts = Capsule::table('vultr_scripts')->where('client_id', $clientID)->get(); | ||
if (empty($allowScripts)) | ||
if (count($allowScripts) < 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also good. |
||
{ | ||
return array(); | ||
} | ||
|
@@ -521,7 +521,7 @@ public static function getUserScripts($clientID, $scripts) | |
public static function getUserSSHKeys($clientID, $keys) | ||
{ | ||
$allowKeys = Capsule::table('vultr_sshkeys')->where('client_id', $clientID)->get(); | ||
if (empty($allowKeys)) | ||
if (count($allowKeys) < 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also good. |
||
{ | ||
return array(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a good and necessary change needed for php72+ from what i can tell