API / Minn\Runtime / Records

Records final class

Minn\Runtime\Records · public/minn/src/Minn/Runtime/Records.php · 133 lines

Posts, terms and comments as WordPress hands them to plugins: found by id (or the one being read), made from a row or an object, and given back as the object, an associative array (ARRAY_A) or a list (ARRAY_N); and whether a value is a list of errors.

Public

staticpost(mixed $post = NULL, mixed $output = 'OBJECT', mixed $filter = 'raw'): mixed#

A post (get_post): the one being read when none is named; a post object as given; one made from a row, an object or an array with an ID; else by id, a copy of the cached one (what one plugin changes is not what the next reader sees). Then put in the context asked for.

staticterm(mixed $term, mixed $taxonomy = '', mixed $output = 'OBJECT', mixed $filter = 'raw'): mixed#

A term (get_term): an error for none or an unknown taxonomy; a term object as given, one made from an object, else by id (null when there is none). get_term and get_{taxonomy} filter the raw term, told its own taxonomy; then it is put in the context asked for, on a copy of a term the caller handed in.

staticcomment(mixed $comment = NULL, mixed $output = 'OBJECT'): mixed#

A comment (get_comment): the one being read for any empty id; a comment object as given; one made from an object with a comment_ID; else by id, its fields text as the database hands them over (null when there is none). Then get_comment.

staticisError(mixed $thing): bool#

Whether a value is a list of errors (is_wp_error); one that is is told to is_wp_error_instance.

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatetermNumbers(Minn\Objects\Term $term): Minn\Objects\Term#

A term's numbers as integers, as the database's text would not give them.

privateshaped(mixed $object, mixed $output): mixed#

A record as the output asks: an associative array (ARRAY_A), a list (ARRAY_N), else the object.