Pinq\Iterators\IOrderedMap::contains PHP Метод

contains() публичный Метод

Returns whether their is value associated with the supplied key.
public contains ( mixed $key ) : boolean
$key mixed
Результат boolean
    public function contains($key);

Usage Example

Пример #1
0
 protected function makeKeyCompatible(&$key, &$maxKey, IOrderedMap $incompatibleKeyMap)
 {
     if (is_int($key) || is_string($key)) {
         //Integer strings like "123" get auto cast to integers when set as array keys
         $intKey = (int) $key;
         if ((string) $intKey === (string) $key && $intKey >= $maxKey) {
             $maxKey = $intKey + 1;
         }
     } elseif ($incompatibleKeyMap->contains($key)) {
         $key = $incompatibleKeyMap->get($key);
     } else {
         $originalKey = $key;
         $key = $maxKey++;
         $incompatibleKeyMap->set($originalKey, $key);
     }
 }
All Usage Examples Of Pinq\Iterators\IOrderedMap::contains