AbstractRow
Abstract class.
The object of a row of a table of your own: a class with #[Table] extends it, and its promoted constructor parameters are the columns.
A row object is loaded with LogEntry::get($id) or LogEntry::find($id), found with LogEntry::query() and
created with new LogEntry(…). save() inserts a new row and sets its primary key, or writes the changed columns of
a loaded one; a row object with a primary key whose row does not exist is inserted with that key. delete() deletes
it.
Every get(), find() and query returns new objects; when two of them change the same row, the last save() of a column wins. save() and delete() check no capabilities.
Methods
find()
The row with the primary key, null if it does not exist.
Returns ?AbstractRow
get()
The row with the primary key.
Returns AbstractRow
Throws InvalidArgumentException: If it does not exist.
query()
A query for rows of the table: all rows in the order of their primary key, see RowQuery.
Returns RowQuery<AbstractRow>
tableName()
The full name of the table on the current site, for SQL of your own: {$wpdb->prefix}{namespace}_{name}.
Returns non-empty-string
delete()
Deletes the row; its primary key is null afterwards, so save() would insert it again.
Throws LogicException: If the row has not been saved yet.
save()
Inserts the row and sets its primary key, or writes the columns changed since it was loaded or saved; without
changes, nothing is written. With a primary key whose row does not exist (set in new, or the row was deleted
in the meantime and the object changed since), the row is inserted with that primary key and all columns.
Throws RuntimeException: If the database refuses the row, e.g. a string longer than its column.