Bitcoin and Altcoin Wallets 6.3.1

Post_Type
in package

Post type base class

Represents a post type that:

  • can be saved and retrieved
  • has fields that are validated with magic accessor methods
  • has metaboxes
  • declares a non-herarchical (tag) custom taxonomy
Tags
since
6.0.0

Introduced.

author

Alexandros Georgiou info@dashed-slug.net

Table of Contents

$object_cache  : mixed
$post_id  : int
The id of the post that this object represents.
__get()  : mixed
Allows getting one of this object's fields.
__set()  : mixed
Allows setting a field for this object, after a few checks.
__toString()  : string
To String.
delete()  : mixed
Trashes this object in the DB.
load()  : mixed
Load a Wallet, Currency, Transaction or Address from its custom post entry.
load_many()  : array<string|int, Post_Type>
Loads Wallets, Currencies, Transactions and Addresses by their post_ids. Quickly.
save()  : void
Saves this object to the DB.
render_bool_field()  : mixed
render_boolean_field()  : mixed
render_number_field()  : mixed
render_secret_field()  : mixed
render_select_field()  : mixed
render_string_field()  : mixed
render_strings_field()  : mixed

Properties

Methods

__get()

Allows getting one of this object's fields.

public abstract __get(string $name) : mixed
Parameters
$name : string

The name of the field to retrieve.

Return values
mixed

__set()

Allows setting a field for this object, after a few checks.

public __set(string $name, mixed $value) : mixed

Subclasses that override this method must delegate to this parent once they do their thing.

Parameters
$name : string

The name of the field. Can be 'post_id', etc.

$value : mixed

The value to set to the field.

Tags
throws
InvalidArgumentException

If value is not appropriate for field or if field does not exist.

Return values
mixed

__toString()

To String.

public abstract __toString() : string

Converts this object into a form that can be written out to logs for debugging.

Return values
string

delete()

Trashes this object in the DB.

public delete([mixed $force = false ]) : mixed
Parameters
$force : mixed = false
Tags
throws
Exception

If the object was not on the DB or if it could not be trashed.

Return values
mixed

load()

Load a Wallet, Currency, Transaction or Address from its custom post entry.

public abstract static load(int $post_id) : mixed
Parameters
$post_id : int

The post_id for the object to load.

Tags
throws
InvalidArgumentException

If the post id is not valid.

since
6.0.0

Introduced.

Return values
mixed

The Wallet, Currency, Transaction or Address loaded.

load_many()

Loads Wallets, Currencies, Transactions and Addresses by their post_ids. Quickly.

public static load_many(array<string|int, mixed> $post_ids[, string|null $post_type = null ]) : array<string|int, Post_Type>

Any IDs not found are skipped silently.

Parameters
$post_ids : array<string|int, mixed>

The post IDs corresponding to the objects to load.

$post_type : string|null = null

Optionally retrieve only posts of this type.

Tags
throws
Exception

If DB access or instantiation fails.

since
6.2.6

Introduced.

Return values
array<string|int, Post_Type>

The instantiated objects.

save()

Saves this object to the DB.

public abstract save() : void

If the object already had a post_id, then the post is updated. Else, a new custom post is created and the new post_id is assigned to the object.

Return values
void

render_bool_field()

protected static render_bool_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_boolean_field()

protected static render_boolean_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_number_field()

protected static render_number_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_secret_field()

protected static render_secret_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_select_field()

protected static render_select_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_string_field()

protected static render_string_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

render_strings_field()

protected static render_strings_field(mixed $schema, mixed $value) : mixed
Parameters
$schema : mixed
$value : mixed
Return values
mixed

Search results