validate() 공개 정적인 메소드

Validates that a key is valid.
public static validate ( mixed $key )
$key mixed The tested key.
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     try {
         return $this->clientExists($key);
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     try {
         $result = $this->connection->fetchAssoc('SELECT * FROM ' . $this->tableName . ' WHERE meta_key = ?', array($key));
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
     return $result ? true : false;
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     try {
         $count = $this->collection->count(array('_id' => $key));
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
     return $count > 0;
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     return array_key_exists($key, $this->array);
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     try {
         return $this->client->bucket($this->bucketName)->get($key)->exists();
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 public function exists($key)
 {
     KeyUtil::validate($key);
     $data = $this->load();
     return array_key_exists($key, $data);
 }