\SearchWP\Entry
\SearchWP\Entry
is responsible for modeling an individual \SearchWP\Source
entry.
Arguments
When instantiating a new \SearchWP\Entry
the following arguments are considered:
source
(string|\SearchWP\Source
)- Either the
\SearchWP\Source
name
or the\SearchWP\Source
itself. (required) id
(string
)- The database row ID of the
\SearchWP\Source
. (required) get_data
(boolean
)- Whether the data should be retrieved at instantiation. (default:
true
) all_attributes
(boolean
)- Whether to retrieve all of the registered
\SearchWP\Attribute
data, or only those that are used in an\SearchWP\Engine
(default:false
)
Methods
When working with \SearchWP\Entry
there are a number of methods to consider.
get_id()
- Getter for ID.
get_source()
- Getter for
\SearchWP\Source
. update_data( $all_attributes = false )
- Updates data.
get_data()
- Getter for data.
native()
- Returns a version of this
\SearchWP\Entry
that the associated\SearchWP\Source
was modeled around e.g. for Posts a properWP_Post
will be returned, populated appropriately. - Note: Not all
\SearchWP\Attribute
s will be populated for core\SearchWP\Source
s e.g. Custom Fields.
Hooks
There are a number of hooks available to further modify the behavior of \SearchWP\Entry
: