Strata\Model\Post

Wraps Wordpress' default Post (of post_type 'post').

    Synopsis

    class Post extends CustomPostType {
    }

    Hierarchy

    Members

    protected

    public

    • $admin_menus — array
      A list of administration sub-menus associated to the custom post type.
    • $belongs_to — array
      A list of taxonomies associated to the custom post type.
    • $belongs_to — array
      A list of taxonomies associated to the custom post type.
    • $permissionLevel — string
      The permission level required for editing by the model
    • $permissionLevel — string
      The permission level required for editing by the model
    • $routedStrata\Model\CustomPostType\boolean|array
      Specifies whether Strata should attempt to automate routing to the model's default controller when the custom post type's slug is matched in the URL.
    • $wpPrefix — string
      The Wordpress custom post type identifier prefix
    • $wpPrefix — string
      The Wordpress custom post type identifier prefix

    Methods

    public

    Inherited from Strata\Model\CustomPostType\CustomPostType

    public

    • getIcon() — Returns the model's menu icon as specified by the 'menu_icon' configuration key.
    • getLabel() — Returns a label object that exposes singular and plural labels
    • getTaxonomies() — Gets the associated taxonomy objects.
    • hasTaxonomies() — Returns whether or not the current model supports and has taxonomies.
    • register() — Registers the custom post type in Wordpress. A Custom post type must trigger this during the 'init' state for it to be recognized automatically by Wordpress.
    • registerAdminMenus() — Registers the custom post type's sub menus.

    Inherited from Strata\Model\WordpressEntity

    public

    Inherited from Strata\Model\Model

    public

    Inherited from Strata\Core\StrataObjectTrait

    public

    • factory() — Instantiates an object that uses the StrataObjectTrait which class name matches the $name value.
    • generateClassName() — Generates a valid class name from the $name value.
    • generateClassPath() — Generates a possible namespace and classname combination of a Strata objecy. Mainly used to avoid hardcoding the '\\View\\Helper\\' string everywhere (or whatever else would the namespace have been).
    • getClassNameSuffix() — Returns the default class name suffix for this object.
    • getFactoryScopes() — Returns scopes in which Strata will look in to load objects.
    • getNamespaceStringInStrata() — Returns the default namespace path.
    • getShortName() — Returns this object's class name without the full namespace.
    • staticFactory() — Instantiates an object of the current class.

    Inherited from Strata\Core\StrataConfigurableTrait

    protected

    • normalizeConfiguration() — Normalizes the configuration cache. This will only run once on the object. It is mainly a safegard against a badly configured value cache.

    public

    • configure() — Instantiate the configuration cache to the state supplied by $config.
    • containsConfigurations() — Returns whether the configuration cache contains something.
    • extractConfig() — Intelligently extract data from the configuration array.
    • getConfig() — Fetches a value in the configuration array
    • getConfiguration() — Returns the object's complete configuration cache.
    • hasConfig() — Confirms the presence of a value in the custom post type's configuration array
    • setConfig() — Saves a value in the object's configuration array for the duration of the runtime.

    Inherited from Strata\Model\CustomPostType\QueriableEntityTrait

    protected

    • wrapInEntities() — Wraps the resultset into entities of the current object type.

    public

    • byAuthorID() — Adds a 'author' condition to the current query.
    • byMenuOrder()
    • byName()
    • byPlublication()
    • byRecency()
    • count() — Fetches the number of results the current queries returned.
    • countTotal() — Returns the total number of entities of the current type.
    • date() — Applies a date query to the querier.
    • direction() — Defines the direction on which the orderby() field will be sorted.
    • fetch() — Executes the query and resets it anew.
    • findAll() — Returns all the possible entities and ends the query.
    • findById() — Finds a model entity by it's ID.
    • first() — Fetches the first element matching the current query and resets it anew.
    • getQueryAdapter() — Return an object inheriting from Query on which requests will be ran. Inheriting classes can modify this to suit their needs.
    • limit() — Sets the maximum number of results the current query may return.
    • listing() — Executes the query and resets it anew.
    • offset() — Sets the starting offset of the current queries result set.
    • orWhere() — Allows the branching of different conditions in the same Wordpress query.
    • orderby() — Defines fields on which to order the current query.
    • paginate() — Paginates the current query. Must be called before the result set has been generated.
    • published()
    • query() — Starts a wrapped wp_query pattern object. Used to chain parameters It resets the query.
    • repo() — Returns an instantiated QueriableEntity to access the repository.
    • resetCurrentQuery() — Resets (forgets) the active query.
    • status() — Shorthand for setting conditions on the post_status column.
    • where() — The default catch all wrapper for WP_Query parameters.