original_string: public function primaryKey()
      {
          if (empty($this->_context['schema']['_constraints']) ||
              !is_array($this->_context['schema']['_constraints'])
          ) {
              return [];
          }
          foreach ($this->_context['schema']['_constraints'] as $data) {
              if (isset($data['type']) && $data['type'] === 'primary') {
                  return isset($data['columns']) ? (array)$data['columns'] : [];
              }
          }
  
          return [];
      }
code: public function primaryKey()
      {
          if (empty($this->_context['schema']['_constraints']) ||
              !is_array($this->_context['schema']['_constraints'])
          ) {
              return [];
          }
          foreach ($this->_context['schema']['_constraints'] as $data) {
              if (isset($data['type']) && $data['type'] === 'primary') {
                  return isset($data['columns']) ? (array)$data['columns'] : [];
              }
          }
  
          return [];
      }
code_tokens: public function primaryKey ( ) { if ( empty ( $ this -> _context [ 'schema' ] [ '_constraints' ] ) || ! is_array ( $ this -> _context [ 'schema' ] [ '_constraints' ] ) ) { return [ ] ; } foreach ( $ this -> _context [ 'schema' ] [ '_constraints' ] as $ data ) { if ( isset ( $ data [ 'type' ] ) && $ data [ 'type' ] === 'primary' ) { return isset ( $ data [ 'columns' ] ) ? ( array ) $ data [ 'columns' ] : [ ] ; } } return [ ] ; }
docstring: Get the fields used in the context as a primary key.
  
  @return array
docstring_tokens: Get the fields used in the context as a primary key .