Listing
model in the examples below, but the API is the same for all models. You can always check the available models in the includes/models
subdirectory of HivePress or its extensions.HivePress\Models\{Model_Name}
class and call the fill
method with an array of field values. You can check the available fields in the model class file or invoke the _get_fields
method that returns an array of field objects. The model object will not be saved in the database until you call the save
method:save
(instead of calling it separately) and get an array of validation errors:get_{field_name}
method:has_{field_name}
and is_{field_name}
aliases for better code readability:display_{field_name}
method instead:serialize
method:set_{field_name}
method to set the field value:fill
method with an array of values:save
method without arguments to save all fields, pass an array of field names to save, or save a single field by calling the save_{field_name}
method:delete
method:Post
or Comment
classes can be moved to Trash: