In frontend application you can control how many informations you want from your content. This means to read more or less fields from database throughout CakePHP associations and Containable Behavior. To see the associations of BEdita object models you should have a look at models definitions.
In every BEdita object model you can also see a class property named $modelBindings
that is an array of different level of bindings. In frontend applications the default modelBindings should be defined from "frontend" key of array, for example in Document model you have:
$modelBindings = array( "detailed" => array(...), "default" => array(...), "minimum" => array(...), "frontend" => array( "BEObject" => array( "LangText", "UserCreated", "RelatedObject", "Category", "Annotation" ), "GeoTag" ) );
Document::modelBindings["frontend"] is the default bindings used when a document is loaded. Of course you can override this default in many way. Every time that a BEdita object is loaded through FrontendController::loadObj() method (that is the standard way to load every BEdita object in frontend applications) BEdita chooses what model bindings to use follow the below order:
FrontendController::modelBindings["BEditaObjectName"]
You can set$modelBindings
property in your controller to define in general or in a specific point what associations have to be used. If you use it in a specific method remember to reset the property to avoid using those model bindings everywhere.$config["modelBindings"]
inapp/config/frontend.ini.php
This is useful if you want that your default model bindings for a frontend are different from those defined in the respective model.BEditaObjectModel::modelBindings["frontend"]
the default as explained above
Example:Document::modelBindings["frontend"]
BEditaObjectModel::modelBindings["minimum"]
, this is the fallback if default above is not defined- if it also miss "minimum" model bindings then an exception is thrown. In this case your model is buggy. Fix it.