Skip to content
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

Support object->exists() #453

Merged
merged 3 commits into from
Oct 9, 2019
Merged

Support object->exists() #453

merged 3 commits into from
Oct 9, 2019

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Oct 9, 2019

No description provided.

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public function exists($useMasterKey = false)
{
if (!$this->objectId) {
return;
Copy link
Contributor

@acinader acinader Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return false here

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$query->get($this->objectId, $useMasterKey);
return true;
} catch (Exception $e) {
if ($e->getMessage() === 'Object not found.') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this test the error code or number instead of the message string?

@codecov
Copy link

codecov bot commented Oct 9, 2019

Codecov Report

Merging #453 into master will decrease coverage by 0.02%.
The diff coverage is 90%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #453      +/-   ##
============================================
- Coverage        98%   97.97%   -0.03%     
- Complexity     1058     1062       +4     
============================================
  Files            39       39              
  Lines          2950     2960      +10     
============================================
+ Hits           2891     2900       +9     
- Misses           59       60       +1
Impacted Files Coverage Δ Complexity Δ
src/Parse/ParseObject.php 97.97% <90%> (-0.14%) 228 <4> (+4)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b7087a...120d6e4. Read the comment docs.

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice.

@dplewis dplewis merged commit eada867 into master Oct 9, 2019
@dplewis dplewis deleted the object-exists branch October 9, 2019 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants