Skip to content
Snippets Groups Projects

Issue #3364706: Refactor transactions

Closed mondrake requested to merge issue/drupal-3364706:3364706-refactor-transactions into 11.x

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
276 292 $this->connection = NULL;
277 293 }
278 294
295 /**
296 * Returns the client-level database connection object.
297 *
298 * This method should normally be used only within database driver code. Not
299 * doing so constitutes a risk of introducing code that is not database
300 * independent.
301 *
302 * @return object
303 * The client-level database connection, for example \PDO.
304 */
305 public function getClientConnection(): object {
  • IIRC it was protected for reason but can't recall why

  • Author Contributor

    Well I can't either, hard to figure out an answer without more context. What I remember is that at some point in [#3174662] I was trying to add the same method, but then it was abandoned on the basis it was not strictly necessary and could be added at a later stage when there were a specific use case (comments #50-#53). Now we have that use case.

  • Suggested change
    305 public function getClientConnection(): object {
    305 public function getClientConnection(): ?object {

    Default value for the property is NULL

  • Author Contributor

    Umm, I disagree... $this->connection is set in the constructor and unset in the destructor, so during the whole lifecycle of the Connection object, this property should not be null. If it is, then it's a problem and it's good to get a TypeError.

  • Please register or sign in to reply
  • mondrake added 35 commits

    added 35 commits

    Compare with previous version

  • mondrake added 4 commits

    added 4 commits

    Compare with previous version

  • daffie
  • daffie
  • daffie
  • daffie
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading