Strata\Model\CustomPostType\ModelEntity

A ModelEntity can vaguely be seen as a table row. It is a class that wraps around a Model instance.

    Synopsis

    class ModelEntity {
    }

    Hierarchy

    Members

    private

    • $associatedObject — mixed
      The object being wrapped around by this class
    • $validationErrors — array
      Current validation errors on the entity.

    public

    • $attributes — array
      A list of model attributes used for automated form generation and validation.

    Methods

    private

    protected

    public

    • __construct() — Upon construction, an entity is associated to an object if one is passed as parameter, the attributes are normalized and the class triggers the init() function.
    • __debugInfo() — Used to express the contents of the model entity more clearly when debugged.
    • __get() — Automated getter. It bridges properties between this object and the associated object.
    • __isset() — Automated validator. It bridges properties between this object and the associated object.
    • __set() — Automated setter. It bridges properties between this object and the associated object.
    • assignRequest() — Assigns the entity data that may be found in the request to this entity.
    • bindToObject() — Associates the entity to another object.
    • delete() — Deletes the current entity
    • extractData() — Extracts the request values related to the entity from a supplied request object.
    • factoryFromPost()
    • factoryFromString() — Factories a model entity based on the Wordpress key
    • factoryFromTerm()
    • factoryFromWpQuery()
    • getAttributes() — Returns the model entity's attributes list.
    • getClassNameSuffix() — {@inheritdoc}
    • getErrors() — Lists the errors on a precise field.
    • getInputName() — Returns the input field suffix when the entity is being used to generate HTML forms.
    • getModel() — Returns the accompanying Model of this entity.
    • getNamespaceStringInStrata() — {@inheritdoc}
    • getValidationErrors() — Returns the current validation error list
    • getWordpressKey() — Returns the entity's unique wordpress key
    • hasErrors() — Checks for errors on a precise field.
    • hasValidationErrors() — Specifies whether there are validation errors currently declared on the entity.
    • init() — Called each time a new object is declared.
    • isBound() — Specifies whether this class has been associated to another object.
    • isSupportedAttribute() — Checks whether the attribute is an attribute that has been declared in the entity's attribute configuration.
    • resetAttributeValue() — Sets the current value of an attribute back to null.
    • resetAttributeValues() — Sets the current value of each entity attributes back to null.
    • save() — Saves the model entity the current post type based on the associated object's values.
    • setValidationError() — Allows the declaration of a validation error on the current entity.
    • toArray() — Returns a list of properties defined on the bound object.
    • toJson() — Returns a list of properties defined on the bound object as json.
    • validate() — Runs validation in a hash object that may or may not be the result of request->data(), but has the same format.
    • validates() — Runs validation on the current entity values as declared by the entity's attributes.

    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.