original_string: public function exists(): bool
      {
          $tableKey = $this->getKeyName();
  
          //If key isn't set we cant associate this record with DB
          if (! isset($this->$tableKey))
          {
              return false;
          }
  
          $sql = 'SELECT EXISTS(SELECT ' . $tableKey . ' FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key LIMIT 1)';
          $query = DB::getConnection()->prepare($sql);
          $query->execute(['key' => $this->getKey()]);
  
          return boolval($query->fetchColumn(0));
      }
code: public function exists(): bool
      {
          $tableKey = $this->getKeyName();
  
          //If key isn't set we cant associate this record with DB
          if (! isset($this->$tableKey))
          {
              return false;
          }
  
          $sql = 'SELECT EXISTS(SELECT ' . $tableKey . ' FROM ' . $this->getTableName() . ' WHERE ' . $this->getKeyName() . ' = :key LIMIT 1)';
          $query = DB::getConnection()->prepare($sql);
          $query->execute(['key' => $this->getKey()]);
  
          return boolval($query->fetchColumn(0));
      }
code_tokens: public function exists ( ) : bool { $ tableKey = $ this -> getKeyName ( ) ; //If key isn't set we cant associate this record with DB if ( ! isset ( $ this -> $ tableKey ) ) { return false ; } $ sql = 'SELECT EXISTS(SELECT ' . $ tableKey . ' FROM ' . $ this -> getTableName ( ) . ' WHERE ' . $ this -> getKeyName ( ) . ' = :key LIMIT 1)' ; $ query = DB :: getConnection ( ) -> prepare ( $ sql ) ; $ query -> execute ( [ 'key' => $ this -> getKey ( ) ] ) ; return boolval ( $ query -> fetchColumn ( 0 ) ) ; }
docstring: Check does the current item exist.
  
  @return bool
docstring_tokens: Check does the current item exist .