invalidValueForType() public static method

public static invalidValueForType ( string $type, string | array $expected, mixed $got ) : MongoDBException
$type string
$expected string | array
$got mixed
return MongoDBException
Beispiel #1
0
 public function convertToDatabaseValue($value)
 {
     if ($value !== null && !is_array($value)) {
         throw MongoDBException::invalidValueForType('Hash', array('array', 'null'), $value);
     }
     return $value !== null ? (object) $value : null;
 }
Beispiel #2
0
 public function convertToDatabaseValue($value)
 {
     if ($value !== null && !is_array($value)) {
         throw MongoDBException::invalidValueForType('Collection', array('array', 'null'), $value);
     }
     return $value !== null ? array_values($value) : null;
 }