ensureConnection(); } /** * Set the operation arguments. * * @param array $args * @return $this */ public function setArgs($args) { $this->args = $args; return $this; } /** * Validate the table name. * * @return void * @throws \InvalidArgumentException */ protected function validateTableName() { if (empty($this->tableName)) { throw new \InvalidArgumentException('Table name is required'); } } /** * Validate the operation arguments. * * @return void * @throws \InvalidArgumentException */ protected function validateArgs() { if (empty($this->args)) { throw new \InvalidArgumentException('Column definitions are required'); } } /** * Generate the full table name with prefix. * * @return void * @throws \InvalidArgumentException */ protected function setFullTableName() { if (empty($this->tableName)) { throw new \InvalidArgumentException('Table name must be set before proceeding.'); } $this->fullName = $this->wpdb->prefix . 'statistics_' . $this->tableName; } /** * Ensure the database connection and initialize the transaction handler. * * @return void */ protected function ensureConnection() { global $wpdb; $this->wpdb = $wpdb; $this->transactionHandler = new TransactionHandler($this->wpdb); } }