1

Is there a function like MongoId::isValid($id)? How do you determine if an object is a MongoDate object? Check if $mongoDateObject->sec isset()?

Chandrew
  • 16,987
  • 4
  • 24
  • 40

2 Answers2

3
  1. if (is_a($mongoDateObject, 'MongoDate')) {...}
  2. if (get_class($mongoDateObject) == 'MongoDate')) {...}
ax.
  • 58,560
  • 8
  • 81
  • 72
2
if ($mongoDateObject instanceof MongoDate) {...}
Machavity
  • 30,841
  • 27
  • 92
  • 100
bartpie
  • 155
  • 2
  • 5